ExWebRTC.Recorder.Converter (ex_webrtc_recorder v0.2.1)
View SourceProcesses RTP packet files saved by ExWebRTC.Recorder
.
Requires the ffmpeg
binary with the relevant libraries present in PATH
.
At the moment, ExWebRTC.Recorder.Converter
works only with VP8 video and Opus audio.
Can optionally download/upload the source/result files from/to S3-compatible storage.
See ExWebRTC.Recorder.S3
and options/0
for more info.
Summary
Functions
Converts the saved dumps of tracks in the manifest to WEBM files.
Types
@type option() :: {:output_path, Path.t()} | {:s3_upload_config, keyword()} | {:download_path, Path.t()} | {:s3_download_config, keyword()} | {:thumbnails_ctx, thumbnails_ctx()} | {:only_rids, [ExWebRTC.MediaStreamTrack.rid() | nil]}
Options that can be passed to convert!/2
.
:output_path
- Directory where Converter will save its artifacts../converter/output
by default.:s3_upload_config
- If passed, processed recordings will be uploaded to S3-compatible storage. SeeExWebRTC.Recorder.S3.upload_config/0
for more info.:download_path
- Directory where Converter will save files fetched from S3../converter/download
by default.:s3_download_config
- Optional S3 config overrides used when fetching files. SeeExWebRTC.Recorder.S3.override_config/0
for more info.:thumbnails_ctx
- If passed, Converter will generate thumbnails for the output files. Seethumbnails_ctx/0
for more info.:only_rids
- By default, when processing a video track with multiple layers (i.e. simulcast), Converter generates multiple output files, one per layer. If passed, Converter will only process the layers with RIDs present in this list. E.g. if you want to receive a single video file from the layer"h"
, pass["h"]
. For single-layer tracks RID is set tonil
, so if you want to handle both simulcast and regular tracks, pass["h", nil]
.
@type options() :: [option()]
@type thumbnails_ctx() :: %{ optional(:width) => pos_integer() | -1, optional(:height) => pos_integer() | -1 }
Context for the thumbnail generation.
:width
- Thumbnail width. 640 by default.:height
- Thumbnail height. -1 by default.
Setting either of the values to -1
will fit the size to the aspect ratio.
Functions
@spec convert!(Path.t() | ExWebRTC.Recorder.Manifest.t(), options()) :: ExWebRTC.Recorder.Converter.Manifest.t() | no_return()
Converts the saved dumps of tracks in the manifest to WEBM files.
If passed a path as the first argument, loads the recording manifest from file.