3 ms·
Thanks that's helpful. Does pion support RTCP? I've tried sending pre-recorded media over WebRTC before. The issue I ran into is that I needed to send keyframes
by simulate-me 4y ago
Thanks that's helpful. Does pion support RTCP? I've tried sending pre-recorded media over WebRTC before. The issue I ran into is that I needed to send keyframes too often leading to a bitrate that was too high for users with slower internet connections. For whatever reason, not all browsers seemed to support keyframe intra refresh, so there were large bitrate spikes whenever a keyframe was sent. RTCP would have solved this problem by allowing clients to request additional keyframes when needed rather than using a high keyframe interval.
- Sean-Der 4y agoYes it does support RTCP. https://github.com/pion/rtcp https://github.com/pion/rtcp We also provide https://github.com/pion/interceptor https://github.com/pion/interceptor. Interceptor is implementations of common RTCP workflows. Things like Congestion Feedback, NACK generation and Congestion Controllers. The idea is that you can use the ones we provide, or use your own!
- simulate-me 4y agoThat’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.