Xav.Reader (xav v0.2.1)
Audio/video files reader.
Summary
Functions
Creates a new audio/video reader.
The same as new/1 but raises on error.
Reads the next frame.
Types
Link to this type
opts()
@type opts() :: [read: :audio | :video, device?: boolean()]
Reader options.
read
- determines which stream to read from a file. Defaults to:video
.device?
- determines whether path points to the camera. Defaults tofalse
.
Functions
Link to this function
new(path, opts \\ [])
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.
Link to this function
new!(path, opts \\ [])
The same as new/1 but raises on error.
Link to this function
next_frame(reader)
@spec next_frame(t()) :: {:ok, Xav.Frame.t()} | {:error, :eof}
Reads the next frame.
A frame is always decoded. Video frames are always in the RGB format. Audio samples are always interleaved.