MP4 module with pseudo streaming + proxy_cache
Roman Arutyunyan
arut at nginx.com
Tue Sep 12 15:33:24 UTC 2017
On Tue, Sep 12, 2017 at 05:21:59PM +0200, Lucas Rolff wrote:
> > 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 many cases).
>
> 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.
In fact, we came up with a pretty solution long ago. The mp4 module should be
a filter. But reimplementing it does not seem to be easy.
> tbs wrote:
> >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
> >http://mailman.nginx.org/mailman/listinfo/nginx
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
--
Roman Arutyunyan
More information about the nginx
mailing list