mirror of
https://github.com/pion/webrtc.git
synced 2025-10-27 01:00:35 +08:00
Logs: TypeError: pc.addStream is not a function. Fixed js error when using safari due to deprecated RTCPeerConnection.addStream() method. Updated js fiddle examples to use the addTrack() method instead.
1.2 KiB
1.2 KiB
rtp-forwarder
rtp-forwarder is a simple application that shows how to forward your webcam/microphone via RTP using Pion WebRTC.
Instructions
Download rtp-forwarder
export GO111MODULE=on
go get github.com/pion/webrtc/v3/examples/rtp-forwarder
Open rtp-forwarder example page
jsfiddle.net you should see your Webcam, two text-areas and a 'Start Session' button
Run rtp-forwarder, with your browsers SessionDescription as stdin
In the jsfiddle the top textarea is your browser, copy that and:
Linux/macOS
Run echo $BROWSER_SDP | rtp-forwarder
Windows
- Paste the SessionDescription into a file.
- Run
rtp-forwarder < my_file
Input rtp-forwarder's SessionDescription into your browser
Copy the text that rtp-forwarder just emitted and copy into second text area
Hit 'Start Session' in jsfiddle and enjoy your RTP forwarded stream!
VLC
Open rtp-forwarder.sdp with VLC and enjoy your live video!
ffmpeg/ffprobe
Run ffprobe -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp to get more details about your streams
Run ffplay -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp to play your streams