github.com/pion/webrtc/v4@v4.0.1/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 encryption, 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  go install github.com/pion/webrtc/v4/examples/insertable-streams@latest
    18  ```
    19  
    20  ### Open insertable-streams example page
    21  [jsfiddle.net](https://jsfiddle.net/t5xoaryc/) you should see two text-areas and a 'Start Session' button. You will also have a 'Decrypt' checkbox.
    22  When unchecked the browser will not decrypt the incoming video stream, so it will stop playing or display certificates.
    23  
    24  ### Run insertable-streams with your browsers SessionDescription as stdin
    25  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:
    26  
    27  #### Linux/macOS
    28  Run `echo $BROWSER_SDP | insertable-streams`
    29  #### Windows
    30  1. Paste the SessionDescription into a file.
    31  1. Run `insertable-streams < my_file`
    32  
    33  ### Input insertable-streams's SessionDescription into your browser
    34  Copy the text that `insertable-streams` just emitted and copy into second text area
    35  
    36  ### Hit 'Start Session' in jsfiddle, enjoy your video!
    37  A video should start playing in your browser above the input boxes. `insertable-streams` will exit when the file reaches the end.
    38  
    39  To stop decrypting the stream uncheck the box and the video will not be viewable.
    40  
    41  Congrats, you have used Pion WebRTC! Now start building something cool