Reputation: 683
Is there any way to recode in ffmpeg by setting the desired output size? I mean something like this
ffmpeg -i in.mp4 -size 650MB out.mp4
So ffmpeg (or a wrapper) calculates the size of the picture, codec, bitrate, and so..
Upvotes: 0
Views: 178
Reputation: 133873
Note that file size = bitrate * duration
and bitrate = file size / duration
. You know your desired file size (650 MB) and your duration (see the output of ffmpeg -i in.mp4
). Now read the two-pass ABR example in the FFmpeg and x264 Encoding Guide. The example really requires the associated explanation otherwise I'd include it here.
Upvotes: 1