View Source Xav.Reader (xav v0.8.0)
Audio/video file reader.
Summary
Functions
Creates a new audio/video reader.
The same as new/1 but raises on error.
Reads and decodes the next frame.
Seeks the reader to the given time in seconds
Creates a new reader stream.
Types
@type opts() :: [ read: :audio | :video, device?: boolean(), out_format: Xav.Frame.format(), out_sample_rate: integer(), out_channels: integer() ]
Reader options.
read
- determines which stream to read from a file. Defaults to:video
.device?
- determines whether path points to the camera. Defaults tofalse
.
@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.
opts
can be used to specify desired output parameters.
Video frames are always returned in RGB format. This setting cannot be changed.
Audio samples are always in the packed form.
See Xav.Decoder.new/2
for more information.
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(), opts()) :: Enumerable.t()
Creates a new reader stream.