ExWebRTC.Recorder (ex_webrtc v0.8.1)
View SourceSaves 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
Functions
Adds new tracks to the recording.
Records a received packet on the given track.
Starts a new ExWebRTC.Recorder
process.
Starts a new ExWebRTC.Recorder
process.
Types
@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.
@type options() :: [option()]
Functions
@spec add_tracks(GenServer.server(), [ExWebRTC.MediaStreamTrack.t()]) :: :ok
Adds new tracks to the recording.
@spec record( GenServer.server(), ExWebRTC.MediaStreamTrack.id(), ExWebRTC.MediaStreamTrack.rid() | nil, ExRTP.Packet.t() ) :: :ok
Records a received packet on the given track.
@spec start(options(), GenServer.options()) :: GenServer.on_start()
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.
@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.