Hi,

Those who might be interested...

Following encoder settings worked for iphone.

void setupVideoEncode(AVCodecContext* c)
{
c->codec_type = CODEC_TYPE_VIDEO;
    c->codec_id = CODEC_ID_H264;
    c->bit_rate = 1000000;

        c->width = g_width;     
   c->height = g_height;

        c->keyint_min = 10;
        c->i_quant_factor = 0.71;
    c->bit_rate_tolerance = 20000;
        c->rc_max_rate = 100000;
        c->rc_buffer_size = 8835000;
        c->qcompress = 0.6;
        c->qmin = 10;
        c->qmax = 30;
        c->max_qdiff = 4;
        c->gop_size = 30;


    c->time_base.num = 1;

        c->time_base.den = 30;
        c->sample_aspect_ratio = av_d2q(1, 255);
        c->profile = 30;

        c->flags |= CODEC_FLAG_LOOP_FILTER;
}

Regards,
Dhaval Shah


On Sat, May 15, 2010 at 10:40 AM, Dhaval Shah <[email protected]> wrote:
> Hi,
>
> I am using ffmpeg with libxh264 lib to encode RTSP stream. I am using
> code posted at following link (on ffmpeg forum) as reference
>
> "http://lists.mplayerhq.hu/pipermail/libav-user/2009-May/003034.html";
>
> So far I am able to encode RTSP stream using libxh264 and can play it
> in VLC but when I try to play it in quick time it says format not
> supported.
>
> Can any one please share the libxh264 encoder settings required for
> producing iphone/ipod compatible video? My encoder settings are as
> given below:
>
> void setupVideoEncode(AVCodecContext* c)
> {
>    c->codec_type = CODEC_TYPE_VIDEO;
>    c->codec_id = CODEC_ID_H264;
>    c->bit_rate = 1000000;
>    c->bit_rate_tolerance = 40000;
>    c->width = g_width;
>    //c->width = 320;
>    c->height = g_height;
>    //c->height = 240;
>    c->time_base.num = 1;
>    c->time_base.den = 60;
>    c->gop_size = 5;
>    c->keyint_min = 5;
>    c->sample_aspect_ratio = av_d2q(1, 255);
>
>    c->b_frame_strategy = 1;
>    c->max_b_frames=0;
>    c->max_b_frames = 0;
>
>    c->pix_fmt = PIX_FMT_YUV420P;
>    c->rc_max_rate = 400000;
>    c->refs = 1;
>
>    // Defaults from ffmpeg.c
>    c->qblur = 0.5;
>    c->qcompress = 0.5;
>    c->b_quant_offset = 1.25;
>    c->b_quant_factor = 1.25;
>    c->i_quant_offset = 0.0;
>    c->i_quant_factor = -0.71;
>
>    /*
>    // codec flags
>    c->flags |= CODEC_FLAG_QSCALE;
>    c->flags |= CODEC_FLAG_GLOBAL_HEADER;
>    c->flags |= 0;
>    c->flags |= 0;
>    c->flags |= 0;
>    c->flags |= 0;
>    c->flags |= 0;
> */
>
>    c->mb_qmax = c->qmax = 51;
>    c->mb_qmin = c->qmin = 10;
>    c->mb_qmin = c->max_qdiff = 4;
>    c->qcompress = 0.6;
>    c->me_range = 16;
>
>    c->coder_type = 1;
>    //c->thread_count = 2;
>        c->thread_count = 1;
>
> }
>
> Thanking you,
> Regards,
> Dhaval
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to