I'm trying to do a 2 pass encoding with ffmpeg but I'm having problems with the frame rate reseting to default 25 by using fps_mode cfr (constant frame rate), if I use something else I also get unwanted results:
fps_mode cfr = The frame rate resets to default (25 fps)
fps_mode vfr = Output video very bad quality and bitrate different from what you specify in -b:v ...
fps_mode passthrough = output has zero size
I'm on Windows
This is an example command that I use:
ffmpeg -i input -vf "select='between(t,60,120)',setpts=N/FRAME_RATE/TB" -c:v libx264 -b:v 1.5M -fps_mode cfr -pass 1 -f null nul && ffmpeg -i input -vf "select='between(t,60,120)',setpts=N/FRAME_RATE/TB" -c:v libx264 -b:v 1.5M -fps_mode cfr -pass 2 output.mp4
If I specify the frame rate with -r with -fps_mode cfr It works, as intended but what if I don't know the frame rate or don't want to bother and just want to make ffmpeg use the same frame rate of the original video how would I do that with 2 pass encoding?