[FFmpeg-user] 2 pass CBR or VBR not really fixing the bitrate?

Manuel Tiglio tiglio at icloud.com
Mon Jul 31 04:58:00 EEST 2017


Hi guys, 


> On Jul 29, 2017, at 3:37 PM, Moritz Barsnick <barsnick at gmx.net> wrote:
> 
> On Sat, Jul 29, 2017 at 17:35:39 -0400, Eric Wilde wrote:
>> At 10:51 PM 7/29/2017 +0200, Moritz Barsnick wrote:
>>> Have you tried using the identical video encoding settings for pass 1
>>> and pass 2? I seem to recall that that is important.
>> 
>> Interesting that you say that.  I use "-an" for the first pass and then
>> "-codec:a libmp3lame -b:a 128k" for the second pass when doing two-pass
>> recording, and it works fine.  My impression was that audio was
>> irrelevant for the first pass, since you were only building a set of
>> compression guide data for the video compressor to use in pass two.
> 
> Please note that I wrote "identical video encoding settings". Indeed,
> the docs say it's okay to omit the audio on first pass, while other
> sources say it makes a difference, as does the target container.
> 
>> The parameters above work for me.  I tried VBR and could never get audio
>> that was synchronized properly with the video, using LAME.  Since 128k,
>> CBR gives acceptable sound, to my ear, and good compression, I wasn't
> 
> Are you talking audio? Yes, libmp3lame hits the target bitrate (be it
> ABR or CBR) pretty much spot on. But Manuel obviously asked about
> video:
> 

You are right Moritz, I am talking about video. 


>> ffmpeg -I <input> -c:v libx264 -pass 1 -f mp4 /dev/null
>> ffmpeg -I <input> -c:v libx264 -b:v avg -maxrate max -minrate min -bufsize buf -pass 2 <output>
> 
> And x264 and x265 (or possibly H.264 and H.265) are known to be tricky.

I guess so, but has anyone had “luck” trying to control the video bitrate fluctuations? I am more than happy to share my experience and details with some CC video, such as Sintel, or any other. I haven’t done that yet so as not to spam everyone, but it is kind of interesting I’d say. 

Decreasing the buffer size improves the fluctuations (they become smaller) but going down to 0.5 secs already seems like a stretch. 

Cheers

Manuel


> 
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".



More information about the ffmpeg-user mailing list