github.com/pion/webrtc/v4@v4.0.1/examples/rtp-forwarder/README.md (about) 1 # rtp-forwarder 2 rtp-forwarder is a simple application that shows how to forward your webcam/microphone via RTP using Pion WebRTC. 3 4 ## Instructions 5 ### Download rtp-forwarder 6 ``` 7 go install github.com/pion/webrtc/v4/examples/rtp-forwarder@latest 8 ``` 9 10 ### Open rtp-forwarder example page 11 [jsfiddle.net](https://jsfiddle.net/fm7btvr3/) you should see your Webcam, two text-areas and `Copy browser SDP to clipboard`, `Start Session` buttons 12 13 ### Run rtp-forwarder, with your browsers SessionDescription as stdin 14 In the jsfiddle the top textarea is your browser's Session Description. Press `Copy browser SDP to clipboard` or copy the base64 string manually. 15 We will use this value in the next step. 16 17 #### Linux/macOS 18 Run `echo $BROWSER_SDP | rtp-forwarder` 19 #### Windows 20 1. Paste the SessionDescription into a file. 21 1. Run `rtp-forwarder < my_file` 22 23 ### Input rtp-forwarder's SessionDescription into your browser 24 Copy the text that `rtp-forwarder` just emitted and copy into second text area 25 26 ### Hit 'Start Session' in jsfiddle and enjoy your RTP forwarded stream! 27 You can run any of these commands at anytime. The media is live/stateless, you can switch commands without restarting Pion. 28 29 #### VLC 30 Open `rtp-forwarder.sdp` with VLC and enjoy your live video! 31 32 #### ffmpeg/ffprobe 33 Run `ffprobe -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp` to get more details about your streams 34 35 Run `ffplay -i rtp-forwarder.sdp -protocol_whitelist file,udp,rtp` to play your streams 36 37 You can add `-fflags nobuffer -flags low_delay -framedrop` to lower the latency. You will have worse playback in networks with jitter. Read about minimizing the delay on [Stackoverflow](https://stackoverflow.com/a/49273163/5472819). 38 39 #### Twitch/RTMP 40 `ffmpeg -protocol_whitelist file,udp,rtp -i rtp-forwarder.sdp -c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmp://live.twitch.tv/app/$STREAM_KEY` Make sure to replace `$STREAM_KEY` at the end of the URL first.