[FFmpeg-user] FFMpeg - How to get the filesize in advance after encoding

Reindl Harald h.reindl at thelounge.net
Tue May 24 13:41:41 EEST 2022

Am 24.05.22 um 12:27 schrieb Ralph Spitzner:
> Reindl Harald wrote on 5/24/22 10:19 AM:
>> Am 24.05.22 um 09:50 schrieb Sendex Six:
>>> Thanks for your response,
>>> What is the formula, logic, or how to compute the file size from a 
>>> video or
>>> audio file? after encoding?
>>> so that in the webpage we can set the content-length of video or audio
>> holy hell this question can't be serious and if you can't figure out 
>> how to get something simple like the filesize hir somebody with basic 
>> knowledge
> I think he wants to know how big file2. encoded from file 1 _will_ be
> ....which of course is impossible to answer

why he writes than "after encoding?"

besides you can't know the size before the conversion in case of 
on-the-fly / streaming a "Content-Length" header is a stupid idea to 
begin with because 
https://en.wikipedia.org/wiki/Chunked_transfer_encoding is the way to go

More information about the ffmpeg-user mailing list