简体   繁体   中英

Can I read an encoded stream from a URL with WebRTC

I'm trying to stream the video of my C++ 3D application (similar to streaming a game).

I have encoded an H.264 video stream with the ffmpeg library (ie internally to my application) and can push it to a local address, eg rtp://127.0.0.1:6666 , which can be played by VLC or other player (locally).

I'm not particularly wedded to h.264 at this point, or rtp. I could send as srtp if that would help.

I'd like to use WebRTC to set up a connection across different machines, but can't see in the examples how to make use of this pre-existing stream - the video and audio examples are understandably focused on getting data from devices like connected web cams, or the display.

Is what I'm thinking feasible? Ie ideally I'd just point webRTC at my rtp://127.0.0.1:6666 address and that would be the video stream source. I am writing out an sdp file as well which can be read by VLC, could I use this in a similar way?

As noted in the comment below there is an example out there using go to weave some magic that enables an rtp stream to be shown in a browser via webRTC.

I am trying to find a more "standard" way to be able to set the source of a video track in webRTC to be the URL of an encoded stream. If there isn't one, that is valuable information to me too, as I can change tack and use a webrtc library to send frames directly.

Unfortunately FFMPEG doesn't support WebRTC output. It lacks support for ICE and DTLS-SRTP.

You will need to use a RTP -> WebRTC bridge. I wrote rtp-to-webrtc that can do this. You can do this with lots of different WebRTC clients/servers!

If you have a particular language/paradigm that you prefer happy to provide examples for those.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM