View Source Xav.Reader (xav v0.11.0)
Audio/video file reader.
Summary
Types
@type t() :: %Xav.Reader{ bit_rate: integer(), codec: atom(), duration: integer(), framerate: {integer(), integer()} | nil, in_channels: integer() | nil, in_format: atom(), in_sample_rate: integer() | nil, out_channels: integer() | nil, out_format: atom(), out_sample_rate: integer() | nil, reader: reference() }
Functions
Creates a new audio/video reader.
Both reading from a file and from a video camera are supported. In case of using a video camera, the v4l2 driver is required, and FPS are locked to 10.
Microphone input is not supported.
The following options can be provided:
:read- The type of the stream to read from the input, eithervideooraudioThe default value is:video.:device?(boolean/0) - Whether the path points to the camera The default value isfalse.:out_format(atom/0) - The output format of the audio samples. For a list of available sample formats checkXav.sample_formats/0.For video samples, it is always
:rgb24.:out_sample_rate(pos_integer/0) - The output sample rate of the audio samples:out_channels(pos_integer/0) - The output number of channels of the audio samples
The same as new/1 but raises on error.
@spec next_frame(t()) :: {:ok, Xav.Frame.t()} | {:error, :eof}
Reads and decodes the next frame.
Seeks the reader to the given time in seconds
@spec stream!(String.t(), Keyword.t()) :: Enumerable.t()
Creates a new reader stream.
Check new/1 for the available options.