ffmpeg : get the size of the converted video

Hi everybody,

I am wondering if there is a way to get the size of a converted video before it has been converted with ffmpeg so then I can configure a progress bar.

Thanks for any help.


I know little of scripting ffmpeg, but I doubt you can get a very accurate size of a video before it’s converted. Many variables play into the size of a final video, especially the complexity of scenes and amount of action. You might be able to estimate or make a guess to its size depending on the options chosen, but warn the user it’s just an estimate.
For the progress bar, maybe you can get the amount of data read from the original file and show a progress of how far it’s been read in. But a multipass process might nullify the progress bar then for 2nd or 3rd passes on the video.
?? Just my 2¢.

You can always specify the video size in advance to ffmpeg. If you do a 2-pass encoding with ffmpeg it will be an acurrate estimate too. That same specified size can be used for your progress bar.