Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
13.15k stars 1.52k forks source link

HLS pass-thought #5426

Open RinCat opened 2 years ago

RinCat commented 2 years ago

Describe the problem to be solved

OBS and some other live streaming software now support generate HLS fragments directly, and HDR live streaming requests use it (RTMP is not supported) https://support.google.com/youtube/answer/10265272

Describe the solution you would like

So a feature that can pass-thought HLS (upload via https) without server side re-encode / re-packing is more efficient and necessary.

stevespaw commented 1 year ago

I also would love to see Direct m3u8 HLS as a "live" source :-)

emansom commented 1 year ago

Implementing this would yield the lowest possible ingestion time of content when streaming with OBS (configured to output in HLS).

As it bypasses the need to run CPU intensive ffmpeg.

For this to work, PeerTube needs to observe a directory (using inotify) where new .ts and .m3u8 files are being appended to.

And use those files as source for a livestream object to create in the database.

Docs should include a chapter on how to configure OBS, WireGuard VPN, NFS share and PeerTube.

kontrollanten commented 1 year ago

Interesting! How does this scale when there's thousand of viewers? Except the bypass of ffmpeg, does it impact the overall performance? Is it possible to combine with object storage?

emansom commented 1 year ago

Interesting! How does this scale when there's thousand of viewers? Except the bypass of ffmpeg, does it impact the overall performance? Is it possible to combine with object storage?

It'd generate similar HLS (.ts fragments and .m3u8 index) as PeerTube would when it invokes ffmpeg.

Possibly PeerTube should/could modify the index somewhat and move files around, to remain compatible with the current storage implementation.

To horizontally scale one could setup multiple PeerTube instances to offer redundancy.

For linear scaling one could configure LVM caching, Ceph/MinIO caching etc.

stevespaw commented 1 year ago

I think that this is similar to this issue 947