MP4 module with pseudo streaming + proxy_cache
lucas at slcoding.com
Tue Sep 12 15:21:59 UTC 2017
> is it too much to ask for nginx to implement this
It depends on what you want to get implemented.
You can just have a location block in nginx handing mp4 and then using
the slice module as Roman already mentioned, this will cause the initial
chunk (which contains the MOOV atom) to be loaded pretty quickly even
for big files, and thus enable pseudo streaming rather quickly (if the
mp4 is not encoded with the MOOV atom in the end which happens in so
The only problem you'll have can be invalidating the cache of a file if
you use the slice module, since you basically have to calculate every
cache entry that you want to remove from the cache (starts from 0 and
increments the number of bytes that you've set in the slice size), the
only thing making it hard is the very last slice since this will be
equal or less than your slice size.
So you can do it already out of the box using the slice module.
Now, sure it would be nice for the mp4 module to support pseudo
streaming for files that are not yet in the cache - this however
requires nginx to be aware of where to seek in a file that is not yet on
the filesystem - it can be done, but I don't think it's super pretty.
> is it too much to ask for nginx to implement this feature if others can do
> it via their own developers?
> i couldn't find developer that are familiar with this, i looked already.
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,276322,276334#msg-276334
> nginx mailing list
> nginx at nginx.org
More information about the nginx