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

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



Am 24.05.22 um 12:55 schrieb Ralph Spitzner:
> 
> 
> Reindl Harald wrote on 5/24/22 12:41 PM:
> mpossible to answer
>>
>> why he writes than "after encoding?"
>>
> maybe it's clear to him, in hist native language.
> As far as I understood it, reading the thread: he wants to do some 'on 
> the fly'
> encoding of a sourcevideo and present a content-legth: header  of the 
> result to the client.
> (for whatever reason)
> I think the problem here is communication, but then again I might be 
> wrong :-)

there is no reason for a Content-Length header and that's common sense

https://en.wikipedia.org/wiki/Chunked_transfer_encoding
Chunked transfer encoding allows a server to maintain an HTTP persistent 
connection for dynamically generated content. In this case, the HTTP 
Content-Length header cannot be used to delimit the content and the next 
HTTP request/response, as the content size is not yet known.


More information about the ffmpeg-user mailing list