[FFmpeg-devel] Assert failing in libavcodec - ratecontrol.c

Neil Brown neilb
Tue Jul 24 22:25:58 CEST 2007

On Sunday July 15, wzrlpy at arsystel.com wrote:
> >>
> >> is this reproduceable with command line ffmpeg? if yes please provide
> >> full uncut output and command line parameters
> >
> > I was hoping someone would know what those asserts really meant and we
> > could work backward from there.....
> > But I can try working forward.  It would probably be easiest if I
> > could feed a number of images (e.g. jpegs) into ffmpeg for it to
> > encode into an mpeg.  I couldn't see anything obvious in the man page
> > which would allow this.  Is there a way to do that?
> Yes: second entry in FAQ. (http://ffmpeg.mplayerhq.hu/faq.html)


Ok, here is the command line:

 ffmpeg -i tmp/%d.jpg -i_qfactor 1.25 -i_qoffset -0.8 -b 20000000 /tmp/xxx.mpeg

where 'tmp' is a directory containing 500 file, the first 250 all the
same, and the next 250 also all the same, but different to the first
250. All files 720x576.

I tried reducing the input set, and with 12 of one image and 1 of the
other, it will 
ffmpeg: ratecontrol.c:756: ff_rate_estimate_qscale: Assertion `q>0.0' failed.

This is the assert immediately after the call to get_diff_limited_q.

The numbers 'i_qfactor' and 'i_qoffset' are the defaults set by the MLT

Are they bad, or is ffmpeg failing to handle them properly?

I had put some tracing in get_diff_limited_q, and when it returned
pict_type was I_TYPE
 last_p_q was 0.631657

This causes q to be calculated as -0.010429.
last_non_b_pict_type was P_TYPE so no further changes were made to


More information about the ffmpeg-devel mailing list