[Ffmpeg-devel] M4V parameters

Luca Zappella luca.zappella
Tue Jun 28 10:38:20 CEST 2005

Hi all,
I am a new user of libavcodec and I need an help.

I have some YUV files grabbed from a camera and I need to create an m4v
file to stream via RTSP.
Right now I am using these parameters to encode but I would like to know
if I could improve the quality or reduce the size of the m4v produced:


One of these : 128*1024 -- 512*1024 -- 1024*1024
Is too much?

codec_context->bit_rate_tolerance = codec_context->bit_rate * 20/100
codec_context->pix_fmt = PIX_FMT_YUV420P;
codec_context->gop_size = gop;
codec_context->flags |= CODEC_FLAG_AC_PRED;  //AC Prediction
codec_context->flags |= CODEC_FLAG_4MV;
codec_context->flags |= CODEC_FLAG_PART;
codec_context->profile = 9;  //Advanced Real Time
codec_context->level = 4;

Are these correct? Can I add some parameters? Am I missing something?
Have I to change something?
I know that one improvement would to be add the b-frames but what else?

Thanks in advance,

More information about the ffmpeg-devel mailing list