phongcao / webrtc-metadata-example

Passing real time metadata synchronized with video frames using WebRTC Native APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebRTC video frame metadata example

This example shows how to pass real time metadata synchronized with video frames using RTP Header Extensions.

webrtc-metadata

Architecture

webrtc-metadata3

How to build

These steps will ensure your development environment is configured properly, and then they'll walk you through the process of building the code.

Prerequisites

Downloading WebRTC source code

Note: Before running webrtcSetup.ps1 script, please ensure PowerShell is set to enable unrestricted script execution.

Open .\config.ps1 and modify WebRTCFolder, which will store WebRTC source code, if needed.

Run .\webrtcSetup.ps1 from the Windows PowerShell command line. This will download and configure the following:

Note: For some reason, if you don't want to apply the metadata patch, run .\webrtcSetupNoPatch.ps1 instead.

Building WebRTC libraries

Run .\webrtcBuild.ps1 from the Windows PowerShell command line. This will build 32bit and 64bit Debug, Release, Exes, Dlls and PDBs of WebRTC.

The actual build

  • Open the WebRTCMetadataExample solution in Visual Studio
  • Build the solution (Build -> Build Solution) in the desired configuration (Build -> Configuration Manager -> Dropdowns at the top)
  • Done!

Build output

After you've built the solution, you'll likely want to start one sample sender implementation, and one sample receiver implementation. These are applications demonstrate the synchronization between video frame and metadata.

Note: you can click on and hold the window title bar, the numbers will freeze for a second so that you can read them.

To run locally, remember to start peerconnection_server.exe, the signaling server, before the sender and receiver apps.

Metadata Id and data channel

Using video frame metadata id, you can easily send additional data via WebRTC data channel and synchronize between sender and receiver.

Known issues

The example uses VP8 encoder/decoder but it's straightforward to support VP9 and H264 codecs.

License

MIT

About

Passing real time metadata synchronized with video frames using WebRTC Native APIs.

License:MIT License


Languages

Language:C++ 91.6%Language:PowerShell 6.4%Language:C 2.0%