View Source ExWebRTC.Media.IVF.Writer (ex_webrtc v0.7.0)

Writes video frames as an IVF file.

Summary

Functions

Updates a number of frames in the header and closes the writer.

Creates a new IVF writer.

Writes an IVF frame into a file.

Types

Functions

@spec close(t()) :: :ok | {:error, term()}

Updates a number of frames in the header and closes the writer.

If a process owning an IVF writer exits, a file open by the IVF writer will be closed automatically but header will not be updated. See also open/2 for more information on automatic header updates.

@spec open(Path.t(),
  fourcc: non_neg_integer(),
  height: non_neg_integer(),
  width: non_neg_integer(),
  num_frames: pos_integer(),
  timebase_denum: non_neg_integer(),
  timebase_num: pos_integer()
) :: {:ok, t()} | {:error, term()}

Creates a new IVF writer.

Initially, IVF header is written with num_frames and is updated every num_frames by num_frames. To have a precise number of frames in the header, either write exactly num_frames or call close/1 at the end of writing.

Link to this function

write_frame(writer, frame)

View Source
@spec write_frame(t(), ExWebRTC.Media.IVF.Frame.t()) :: {:ok, t()} | {:error, term()}

Writes an IVF frame into a file.