[FFmpeg-user] Limiting frame rate on encoding videos

Fred M. Sloniker fredsloniker at gmail.com
Sun Nov 6 00:15:17 EET 2016


I encode videos for Livestream pretty routinely, and I'm looking to 
automate the process a bit more. Specifically, classic Livestream (which 
is what I use) has a 25 FPS maximum to use FLVs straight and not 
re-encode them. I can use an FFmpeg filter to set my output FPS to 25, 
but that's not what I want, because if my source video already has a 
framerate less than 25, there's no sense increasing it for no reason.

So. Is there a way to tell FFmpeg to only /decrease/ to the desired 
framerate, similar to the 'force_original_aspect_ratio=decrease' 
setting? Or a way to say, for instance, 'set FPS to the minimum of 25 
and the current frame rate'? This is the line I'm currently using in my 
Windows batch file; I believe setting the FPS /to/ 25 would be as simple 
as adding ',fps=25' inside the quoted parameters for -vf, but I haven't 
tested it.

"D:\ffmpeg\ffmpeg" -y -i "%~1" -vf 
"scale=w=480:h=360:force_original_aspect_ratio=decrease" -b:v 400k -b:a 
64k -ar 22050 -f flv "%~n1.flv"



More information about the ffmpeg-user mailing list