github.com/pion/webrtc/v3@v3.2.24/examples/insertable-streams/README.md (about) 1 # insertable-streams 2 insertable-streams demonstrates how to use insertable streams with Pion. 3 This example modifies the video with a single-byte XOR cipher before sending, and then 4 decrypts in Javascript. 5 6 insertable-streams allows the browser to process encoded video. You could implement 7 E2E encyption, add metadata or insert a completely different video feed! 8 9 ## Instructions 10 ### Create IVF named `output.ivf` that contains a VP8 track 11 ``` 12 ffmpeg -i $INPUT_FILE -g 30 output.ivf 13 ``` 14 15 ### Download insertable-streams 16 ``` 17 export GO111MODULE=on 18 go get github.com/pion/webrtc/v3/examples/insertable-streams 19 ``` 20 21 ### Open insertable-streams example page 22 [jsfiddle.net](https://jsfiddle.net/t5xoaryc/) you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox. 23 When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates. 24 25 ### Run insertable-streams with your browsers SessionDescription as stdin 26 The `output.ivf` you created should be in the same directory as `insertable-streams`. In the jsfiddle the top textarea is your browser, copy that and: 27 28 #### Linux/macOS 29 Run `echo $BROWSER_SDP | insertable-streams` 30 #### Windows 31 1. Paste the SessionDescription into a file. 32 1. Run `insertable-streams < my_file` 33 34 ### Input insertable-streams's SessionDescription into your browser 35 Copy the text that `insertable-streams` just emitted and copy into second text area 36 37 ### Hit 'Start Session' in jsfiddle, enjoy your video! 38 A video should start playing in your browser above the input boxes. `insertable-streams` will exit when the file reaches the end. 39 40 To stop decrypting the stream uncheck the box and the video will not be viewable. 41 42 Congrats, you have used Pion WebRTC! Now start building something cool