[FFmpeg-user] q values and bitrate

betonpfeiler betonpfeiler at googlemail.com
Thu May 3 21:29:54 CEST 2012


On 05/03/2012 07:44 PM, Chris Vincze wrote:
> Hi there
>
> <mailto:ffmpeg-user at ffmpeg.org>
>
> I'm trying to encode MPEG2 files for broadcast. The spec is MPEG-2 @ 50Mbps with all frames as intra frames.
>
>
> So I've done a few experiments and have come across a conundrum.
>
>
> Setting the q flags like this:
>
>
> ffmpeg -i input.%04d.dpx -vcodec mpeg2video -pix_fmt yuv422p -intra -qmin 1 -qscale 1 -output.mpg
>
>
> gives a constant q=1.0 while transcoding and produces a file of approximately 25Mbps (although weirdly the file bitrate is given as: bitrate: 25551 kb/s while the actual stream is specified as 104857 kb/s. Is that the peak or just incorrect?)
>
>
> Duration: 00:01:29.95, start: 1.000000, bitrate: 25551 kb/s
>
>
> Stream #0.0[0x1e0]: Video: mpeg2video, yuv422p, 720x608 [PAR 608:405 DAR 16:9], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, 2 channels, s16, 384 kb/s
>
>
>
> However, specifying a constant bit rate like this:
>
>
> ffmpeg -i input.%04d.dpx -vcodec mpeg2video -pix_fmt yuv422p -intra -b 50000k -minrate 50000k -maxrate 50000k -bufsize 2000000 -output.mpg
>
>
> gives a varying q whilst transcoding somewhere between 1 and 6. The resulting file is 50Mbps (in both the file and the video stream)
>
>
>
> However, visually, the quality of this file is not as good as the 25Mbps (as suggested by the q factor), although it should be better I would have thought.
>
>
> Unfortunately the files will be rejected by the broadcaster if they are not 50Mbps. So my question is how can I produce a file of 50Mbps AND q=1. It is my understanding that the q flags and the bitrate flags are mutually exclusive (I've tried running both).
>
>
>
> Thanks very much for your help
>
>
> Chris
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
Hello there,

I would guess your broadcaster wants not just any 50Mbps MPEG-2 file, I 
think he might want an D10 (or IMX) file. You might want to take a look 
at the FFMPEG Broadcast branch FFMBC. Otherwise there is a (little 
outdated but still useful) HowTo site for FFMPEG: 
http://www.itbroadcastanddigitalcinema.com/ffmpeg_howto.html

Greetings,
J


More information about the ffmpeg-user mailing list