ExWebRTC.Recorder (ex_webrtc v0.8.1)

View Source

Saves received RTP packets to a file for later processing/analysis.

Dumps raw RTP packets fed to it in a custom format. Use Recorder.Converter to process them.

Summary

Types

Options that can be passed to start_link/1.

Types

option()

@type option() ::
  {:base_dir, String.t()} | {:on_start, (-> [ExWebRTC.MediaStreamTrack.t()])}

Options that can be passed to start_link/1.

  • base_dir - Base directory where Recorder will save its artifacts. ./recordings by default.
  • on_start - Callback that will be executed just after the Recorder is (re)started.
             It should return the initial list of tracks to be added.

options()

@type options() :: [option()]

Functions

add_tracks(recorder, tracks)

@spec add_tracks(GenServer.server(), [ExWebRTC.MediaStreamTrack.t()]) :: :ok

Adds new tracks to the recording.

record(recorder, track_id, rid, packet)

Records a received packet on the given track.

start(recorder_opts \\ [], gen_server_opts \\ [])

Starts a new ExWebRTC.Recorder process.

ExWebRTC.Recorder is a GenServer under the hood, thus this function allows for passing the generic GenServer.options/0 as an argument.

start_link(recorder_opts \\ [], gen_server_opts \\ [])

@spec start_link(options(), GenServer.options()) :: GenServer.on_start()

Starts a new ExWebRTC.Recorder process.

Works identically to start/2, but links to the calling process.