3 ms·
That’s cool. Do you have any examples of doing real-time media streaming? I guess pion is just the transport layer; so you need a separate media library?
by simulate-me 4y ago
That’s cool. Do you have any examples of doing real-time media streaming? I guess pion is just the transport layer; so you need a separate media library?
- Sean-Der 4y agoWhat in particular are you looking for? If you want the ‘conference use case’ LiveKit, Galene and ion-SFU are all popular
- simulate-me 4y agoI'm looking to take a pre-recorded video file and stream it to a WebRTC client. I use an SFU, but I don't think that's the important part. The main issue is transcoding the video in a format that the browser supports and in a way that can respond to RTCP feedback signals. For instance, you can generate an RTP SDP file to use as the output for an FFmpeg CLI command, but the FFmpeg CLI has no support for RTCP. You had mentioned that pion was used to stream pre-recorded media over WebRTC, so I was hoping you had an example of doing so that properly handled RTCP.
- Sean-Der 4y agoFor getting media out of ffmpeg you have https://github.com/pion/webrtc/tree/master/examples/rtp-forwarder https://github.com/pion/webrtc/tree/master/examples/rtp-forw... For playing media from disk you have https://github.com/pion/webrtc/tree/master/examples/play-from-disk https://github.com/pion/webrtc/tree/master/examples/play-fro... To see how to accept and process RTCP see https://github.com/pion/webrtc/tree/master/examples/rtcp-processing https://github.com/pion/webrtc/tree/master/examples/rtcp-pro... The example-webrtc-applications repo also shows how you could get media from GStreamer.
- simulate-me 4y agoI see, so these examples still suffer from the keyframe issue. As far as I know, there is no good solution to this issue, but I'd be interested in hearing how pion's consumers handle this issue. Streaming a file from disk is ideal because it's really cheap and doesn't require any video transcoding, but as soon as you need to insert additional keyframes, then at least some portion of the source video needs to be transcoded again.
- Sean-Der 4y agoI can't seem to respond simulate-me because our comments are too deeply nested. Pion doesn't have a way to exactly implement your business logic. You have two choices (and they both can be implemented with Pion) * Store everything since the last keyframe and RTX to the user. You have access to PLIs and NACKs so you can do that. * Request a new keyframe from the encoder. I would love to ship something that exactly meets your need, but I don't think I can.
- simulate-me 4y agoYou can respond if you click the timestamp of the comment :). I understand that pion is a transport library, I was mostly wondering if you've seen anyone solve this issue. To give you a little background, we built an app that allowed a movie containing a children's story to be read aloud with the participants.The movie streamed from our servers of WebRTC. It worked well, but we found that users in Europe often have DSL and using a keyframe interval of 3 seconds was too much for their connections to handle. Increasing the keyframe interval lead to situations where users saw nothing when they first connected. We eventually switched to synchronized local playback for media, but it's much more difficult to time perfectly and people have noticed it's more out-of-sync than before.
- Sean-Der 4y agoI am happy to help you implement either of the solutions I have seen (from my other comment)! Email me sean @ pion.ly But people are successfully streaming pre-recorded media. You have to do out of band communication, and that will just have to be custom afaik :/
- Uehreka 4y agoJust a heads up, in future conversations you may want to mention the DSL part at the beginning. WebRTC over DSL is definitely not impossible, but you’re going to be dealing with whole classes of issues most WebRTC devs aren’t running into on a regular basis. It’s also unfortunately true that many modern use cases for WebRTC are only possible because cable, fiber, and 3G/4G/5G have increased the bandwidth available to most users. So it may be the case that what you’re looking for does not in fact exist. But keep looking! Just make sure to mention that you’re targeting DSL so people know not to recommend things you’ve already ruled out.