[Patch] flv: add support for time offset

Jianyong Chen balus at foxmail.com
Tue Aug 13 03:10:23 UTC 2019


Thank you for your reply and detailed explanation.

However, as for the flv module, parsing metadata is not that
complex for nginx, cause we just need the two arrays, moreover, in
this module we just store the offsets of them. Most importantly,
in CDN field, time offset is a necessity and I believe many CDN
companies will implement time offset and we could offer this
missing functionality. I hope you can give it a second thought.


> On Aug 12, 2019, at 7:33 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> 
> Hello!
> 
> On Sun, Aug 11, 2019 at 05:48:55PM +0800, Jianyong Chen wrote:
> 
>> I have been reading nginx source code recently and found that flv module is too
>> simple, more specifically, it lacks support for time offset unlike mp4 module does.
>> 
>> However, in real life, the demand for time offset is more common than it for
>> byte offset, especially in CDN field. In addition to CDN, many video players use
>> time offset to implement drag function. But the original module only supports
>> byte offset, so I think it is necessary to add this feature and I have finished it.
>> 
>> To support time offset, I had to parse the metadata, but I haven’t found an
>> efficient and elegant solution, so I referred to the nginx-rtmp module in this
>> part(Thanks, Roman Arutyunyan). As for byte offset, I just kept it consistent
>> with the original module.
>> 
>> I published the project in GitHub, and here is the address:
>> https://github.com/BalusChen/nginx-flv-module, where you can find more detail.
>> 
>> By the way, does anyone have interest in aligning keyframes for mp4 module?
>> I'm willing to do this job.
>> 
>> And Maxim Dounin, could you please give me some comments or suggestions?
>> I'll appreciate it.
> 
> One of the main benefits of the FLV format is that it doesn't 
> require parsing on the server side, and all known FLV players are 
> able to provide byte offsets.  Trying to add time offsets does not 
> look like an improvement to me - parsing complex formats is not 
> something a web server should do.
> 
> Note well that the fact that MP4 cannot work with byte offsets and 
> instead requires time offsets is not a feature of the MP4 module, 
> but rather a limitation of the format and players available.  
> Fortunately, modern brosers are able to use range requests with 
> MP4 files, potentially making the MP4 module unneeded in the 
> future.
> 
> [...]
> 
> -- 
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel





More information about the nginx-devel mailing list