[FFmpeg-user] Strange CPU usage in MPEG2 encoding

SF sylvain at lahiette.com
Tue Aug 12 16:27:34 CEST 2014


I am using the libav* libraries from FFMPEG to produce a MPEG2 video in MPEG2-TS stream.
I discovered that the usage of some options are changing dramatically the CPU used to encode a frame : 
     *  If i use only the  "b" (bitrate) option, it takes approx. between 3-7 ms to encode a 720x576 picture, which looks perfect for me.
     *  If i add "maxrate" and "bufsize" options, then it  varies between 5 ms and 80ms (yes !) for the same video sequence. It seems to be related to movement in the scene, but i do not see the relationship between the maxrate/bufsize parameters and the movement.
Unfornunatly, i am obliged to use the maxrate/bufsize options to have a proper decoding on the other side. If i just provide the "b" options, then i got bunch of "Invalid frame size 0x0" on the decoder side.
Hence my questions : 
     *  Do you have an idea why the maxrate/bufsize options are using so much PCU ?
     *  If yes, is there any way to fix it (either by changing options, etc, etc) ?
Thanks for your support.

More information about the ffmpeg-user mailing list