MP4 pseudostreaming - seek delay

Igor Sysoev igor at sysoev.ru
Mon Mar 5 07:08:15 UTC 2012


On Mon, Mar 05, 2012 at 01:53:00AM -0500, dagr wrote:
> Hi
> 
> I configured streaming with ngx_http_mp4_module . 
> I use optimized mp4 with moov atoms located at the beginning of the
> file. 
> Streaming really works,  BUT. 
> In comparison with flv its takes much more time to seek through movie. 
> 
> For example i want to move to position - 00:05:00, it takes about half
> second or even 2 secs  to finish. 
> When i used flv - it was instant, also seeking mp4 videos on youtube is
> instant too.
> 
> I noticed that player shows downloading status during this delay , so i
> checked tcpdump and found out, that 
> nginx sends moov atom  to player  EVERY time.  Moov data is about 300KB,
> so only after downloading it , player starts getting real video. 
> 
> I understand why player needs MOOV data, when send first GET without
> "start" parameter. 
> 
> But i really dont understand why it needs same MOOV data later, when
> sends request like GET /file.mp4?start=300
> 
> Can you clear out these issue for me? 
> May be i misconfigured something ?
> 
> nginx-1.0.12

This is expected behaviour. This is the way, how Flash players work:
they require complete MP3 stream with MOOV/MDAT on each request.
This is the reason why ngx_http_mp4_module exists at all. If the players
were able play without MOOV data on each request using MOOV data from
the first request, there was no need in ngx_http_mp4_module. The module
adjusts MOOV data for each request. If you seek MP4 file near the end,
the MOOV data will be lesser.


-- 
Igor Sysoev



More information about the nginx mailing list