[FFmpeg-user] RE-ENCODING "SIMULATION"

Ferdi Scholten ferdi at sttc-nlp.nl
Sat Mar 2 22:58:54 EET 2024


Hello all,
> By providing to ffmpeg (release 6.1) or ffprobe (release 6.1) :
> -> the path of a audio-video source file ;
> -> the parameters envisaged for re-encoding (audio+video codecs, audio+video bitrates, scale criterias) ;
>
> is it possible to know an assessment of the size of the final file (the file obtained by re-encoding the source file) ; without actually re-encoding ?
>
> If so, how do we need to proceed ?
>
> Are there additionnal parameters required to make the assessment, and which ones ?
>
> Thanks for your help and your advices.
>
> Regards,
> HA
>
Well No, unless....

Depending on the Codec you can set a specific size to aim for. Using 
dual or triple encoding passes you will get a video of that size with 
the best possible quality for that codec with the criteria you specified.

Otherwise when aiming for a certain quality there is no way to predict 
the actual filesize as it differs with the content of the video.

When using a fixed bitrate, then you can calculate the resulting size 
exactly, if the codec sticks with it. But several codecs will use 
smaller bitrates if the specified bitrate is higher than needed for the 
content, or raise the bitrate temporarily if needed to accommodate 
content needing it. Most modern codecs allow to set margins for the 
specified bitrate.

Really, read the documentation about encoding and for the codecs you 
wish to use!


More information about the ffmpeg-user mailing list