|
|
1 an în urmă | |
|---|---|---|
| .. | ||
| jsfiddle | 1 an în urmă | |
| README.md | 1 an în urmă | |
| main.go | 1 an în urmă | |
insertable-streams demonstrates how to use insertable streams with Pion. This example modifies the video with a single-byte XOR cipher before sending, and then decrypts in Javascript.
insertable-streams allows the browser to process encoded video. You could implement E2E encyption, add metadata or insert a completely different video feed!
output.ivf that contains a VP8 trackffmpeg -i $INPUT_FILE -g 30 output.ivf
export GO111MODULE=on
go get github.com/pion/webrtc/v3/examples/insertable-streams
jsfiddle.net you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox. When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates.
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:
Run echo $BROWSER_SDP | insertable-streams
insertable-streams < my_fileCopy the text that insertable-streams just emitted and copy into second text area
A video should start playing in your browser above the input boxes. insertable-streams will exit when the file reaches the end.
To stop decrypting the stream uncheck the box and the video will not be viewable.
Congrats, you have used Pion WebRTC! Now start building something cool