Enabling "Transfer-Encoding : chunked"
Maxim Dounin
mdounin at mdounin.ru
Mon Sep 24 16:11:06 UTC 2018
Hello!
On Mon, Sep 24, 2018 at 11:40:27AM -0400, anish10dec wrote:
> Thanks Maxim
>
> For Streaming with Low Latency , Harmonic Encoder is pushing media files
> with "Transfer-Encoding: chunked" on the Nginx Origin Server.
>
> We are able to see the same in tcpdump between Encoder and Nginx Origin.
Ok, so everything works as intended when using proxying, right?
> However when we try to stream content through Origin Server ,
> "Transfer-Encoding: chunked" is missing in the header part because of which
> player is not able to start stream with enabling low latency
>From your description it is not clear what you are trying to do
here. If you are trying to save HLS encoding results to disk and
then serve them using nginx as static files, then it is not going
to work with HLS low-latency streaming - because nginx does not
know if a particular segment file is complete, or it is being
written right now and anything added to the file needs to be sent
to the client till some unspecified moment in the future.
If you want low latency live HLS streaming to work, you'll have to
use proxying at least for the last segment (the one which is being
written to).
If you observe problems with already completed segments (that is,
segments which are fully complete, and their length already known)
once they are served with Content-Length, this is probably
something to be addressed in the client. As previously explained,
there is no difference between "Content-Length" and
"Transfer-Encoding: chunked" if full length of a response is known
in advance.
--
Maxim Dounin
http://mdounin.ru/
More information about the nginx
mailing list