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..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that
file size = bitrate * durationandbitrate = file size / duration. You know your desired file size (650 MB) and your duration (see the output offfmpeg -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.