monyone / node-ts-fragmenter

convert mpegts to fragments for ll-hls
MIT License
14 stars 1 forks source link

How to use it ? #1

Open nums opened 2 years ago

nums commented 2 years ago

How can I test this package ?

I see that there is a package which use it : https://github.com/monyone/node-llhls-origin-example but I don't know how to inject MPEGTS stream ?

Thanks

monyone commented 2 years ago

node-ts-fragmenter works node.js stream and segment/partial segment origin. use index.ts for mpegts stream to pipe. so, easy to implement any node.js server side.

node-llhls-origin-example is a sample for express and recieve mpegts stream by stdin.

monyone commented 2 years ago

also, https://github.com/monyone/biim is fragmenter and origin server implementation by python.

nums commented 2 years ago

Thanks for your answers :) I will test today and I let you know

nums commented 2 years ago

So yes, it's working great on iOS, I've got 4 secondes latency. I did not manage to make it work on a player like Theo player. Is it the same for you ?

monyone commented 2 years ago

@nums Thanks for using this library! I want you to say anything about this library.

I've got 4 secondes latency.

This algorithm generate 1 segment per IDR frame. So needs decease IDR interval for optimize latency. But AVPlayer always buffer 1 seconds...

I did not manage to make it work on a player like Theo player. Is it the same for you ?

Yes. It cause by incorrect pes_length = 0 handling (it used by video, so video not showing) (New Implementation biim is normally playable hls.js or other player)

I'll fix this behavior. Sorry for inconvinience.

nums commented 2 years ago

Thanks for your feedback, I tested with an IDR of 1 and I've got 3 secondes latency, I think I can win a little more because of my broadcast setup (it's not concerning your repo), so it's great.

I will also do stability tests over a long broadcast time and I will let you know if I have any feedback.

Ok for biim I will take a look.

Thanks a lot for your work !

monyone commented 2 years ago

@nums Thanks for response! I released new bug fix version (for above problem), so try new version!

It cause by incorrect pes_length = 0 handling (it used by video, so video not showing)

I test hls.js used by new version of node-ts-fragmenter (0.0.4), it seems normally played. Perhaps Theo player as well.

nums commented 2 years ago

@monyone thanks a lot ! It's working great now on the hls.js

monyone commented 2 years ago

@nums thank you!

LL-HLS allows subseconds segment and retrive manifest subseconds by long polling. Apple LL-HLS use Delta Update by PART-TARGET, not TARGETDURAION. So, LL-HLS can less than 1 seconds IDR for minimize latency. (It is tradeoff by stability)

I hope this implementation (Apple LL-HLS) will be to your knowledge. And Looking forward to your new service!