[FFmpeg-user] Shrinking Videos to Constant Height

Harold Goranson tedg at alum.mit.edu
Sun Sep 14 07:20:45 CEST 2014

On Mon, Sep 8, 2014, at 12:04 PM, Harold Goranson wrote:
>I wish to recode them as modern mp4
>to 300p high  and as wide as required
>to maintain correct aspect ratio, rounded
>to the nearest 2p. No sound, but all other 
>qualities the same.

Lou replied:
You can use the scale filter: 
 -vf scale=300:-2


ffmpeg -i Source.mkv  scale=300:-3 Result.mpg

This works perfectly. Thank you. Now I need to elaborate the process.
The use case has two goals: 

— a consistent source for an elaborate process that extracts slices from frames selected from every second and recomposes them. These scripts are a separate process to create a scrubber strip.

For this it is desirable that frames be of high quality. I suppose that reducing the framerate to 24fps is useful. It seems that VBR is desirable here. Encoding time is not a constraint.

— the source for streaming a 300p tall version of the film, using h264. 

A ramble around references gives no clear guidance on this, but it appears that regular periodic I-frames (say every 4 seconds) and heavy use of B-frames is desirable. VBR seems acceptable here as well, using two-pass encoding controlled by the average bitrate setting.

Are these two use cases in conflict? It is easy enough to make two products. 

Am I right in thinking that reduced frame rate and 2-pass VBR is desirable?

What would the command look like to accomplish this?


More information about the ffmpeg-user mailing list