News for hackers. Stuff that matters.
Re:Show HN: AV1 and WebRTC by simulate-me on Tuesday April 12, 2022 @02:36PM (#31006642)
I'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.
Re:Show HN: AV1 and WebRTC by Sean-Der on Tuesday April 12, 2022 @03:33PM (#31007259)
For getting media out of ffmpeg you have 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-fro...

To see how to accept and process RTCP see https://github.com/pion/webrtc/tree/master/examples/rtcp-pro...

The example-webrtc-applications repo also shows how you could get media from GStreamer.

Re:Show HN: AV1 and WebRTC by simulate-me on Tuesday April 12, 2022 @04:16PM (#31007737)
I 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.
Re:Show HN: AV1 and WebRTC by Sean-Der on Tuesday April 12, 2022 @04:27PM (#31007835)
I 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.

Re:Show HN: AV1 and WebRTC by simulate-me on Tuesday April 12, 2022 @04:34PM (#31007913)
You 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.

Re:Show HN: AV1 and WebRTC by Uehreka on Tuesday April 12, 2022 @06:19PM (#31008944)
Just 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.

Re:Show HN: AV1 and WebRTC by Sean-Der on Tuesday April 12, 2022 @05:26PM (#31008423)
I 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 :/