github.com/pion/webrtc/v4@v4.0.1/examples/ortc-media/README.md (about)

     1  # ortc-media
     2  ortc demonstrates Pion WebRTC's [ORTC](https://ortc.org/) capabilities. Instead of using the Session Description Protocol
     3  to configure and communicate ORTC provides APIs. Users then can implement signaling with whatever protocol they wish.
     4  ORTC can then be used to implement WebRTC. A ORTC implementation can parse/emit Session Description and act as a WebRTC
     5  implementation.
     6  
     7  In this example we have defined a simple JSON based signaling protocol.
     8  
     9  ## Instructions
    10  ### Create IVF named `output.ivf` that contains a VP8/VP9/AV1 track
    11  ```
    12  ffmpeg -i $INPUT_FILE -g 30 -b:v 2M output.ivf
    13  ```
    14  
    15  **Note**: In the `ffmpeg` command which produces the .ivf file, the argument `-b:v 2M` specifies the video bitrate to be 2 megabits per second. We provide this default value to produce decent video quality, but if you experience problems with this configuration (such as dropped frames etc.), you can decrease this. See the [ffmpeg documentation](https://ffmpeg.org/ffmpeg.html#Options) for more information on the format of the value.
    16  
    17  
    18  ### Download ortc-media
    19  ```
    20  go install github.com/pion/webrtc/v4/examples/ortc-media@latest
    21  ```
    22  
    23  ### Run first client as offerer
    24  `ortc-media -offer` this will emit a base64 message. Copy this message to your clipboard.
    25  
    26  ## Run the second client as answerer
    27  Run the second client. This should be launched with the message you copied in the previous step as stdin.
    28  
    29  `echo BASE64_MESSAGE_YOU_COPIED | ortc-media`
    30  
    31  This will emit another base64 message. Copy this new message.
    32  
    33  ## Send base64 message to first client via CURL
    34  
    35  * Run `curl localhost:8080 -d "BASE64_MESSAGE_YOU_COPIED"`. `BASE64_MESSAGE_YOU_COPIED` is the value you copied in the last step.
    36  
    37  ### Enjoy
    38  The client that accepts media will print when it gets the first media packet. The SSRC will be different every run.
    39  
    40  ```
    41  Got RTP Packet with SSRC 3097857772
    42  ```
    43  
    44  Media packets will continue to flow until the end of the file has been reached.
    45  
    46  Congrats, you have used Pion WebRTC! Now start building something cool