libav/audio.lisp
An open file's sound and its decoder.
Open pathname's best audio stream and start a decoder for it.
Returns an audio-track, or NIL when the file has no sound. The caller owns
it and must close-audio it.
AV_TIME_BASE is a million.
Decode until track's frame holds the next run of samples, or NIL at the
end of the file.
How many samples per channel track's current frame holds.
Return track's current frame folded to mono single-floats, and how many.
buffer is reused when it is large enough; otherwise a fresh one is made. The
count is the number of samples written, which is what matters, since the
buffer may be longer. Every sample format a decoder hands out is read here
directly -- planar or interleaved, 8/16/32-bit integer, float, or double --
because that is a small table and a resampler is a large dependency.
Sum the channels of each sample; planar data is one pointer per channel, interleaved is one pointer with the channels side by side.
An open file's sound and its decoder.
An open video file and its decoder.
(video)Decode until VIDEO's frame holds the next picture. Return the frame or NIL. NIL means the file is exhausted; VIDEO's frame is left holding the last picture that was decoded.
One demuxer and one decoder on one stream of an open file. The pump in DECODE-NEXT-FRAME is the same whatever the stream carries; a VIDEO adds pictures and their conversion, an AUDIO-TRACK adds samples. The accessors keep the VIDEO- prefix they were born with: the picture path came first, and every caller of it says…
(pathname)Open PATHNAME's best audio stream and start a decoder for it. Returns an AUDIO-TRACK, or NIL when the file has no sound. The caller owns it and must CLOSE-AUDIO it.
(track)(&optional directory)Load libavutil, libavcodec, and libavformat, and check their versions. DIRECTORY is useful for builds which have not been installed. When it is NIL, LUV_FFMPEG_LIBDIR is consulted before the platform soname search. Signals LIBAV-VERSION-MISMATCH when a loaded library disagrees with the headers this system was…
(&body body)Run BODY with the floating-point environment FFmpeg's own code expects. FFmpeg computes with floats that raise invalid-operation and divide-by-zero as a matter of course -- probing stream timing alone will do it -- and SBCL traps those by default, so an unmasked call dies inside avformat_find_stream_info rather than…
(code operation)(format-context index)Logical conjunction of tests and raw truth values.
Division of two represented quantities.
(video)(track)(video)(track)Decode until TRACK's frame holds the next run of samples, or NIL at the end of the file.
(track &optional buffer)Return TRACK's current frame folded to mono single-floats, and how many. BUFFER is reused when it is large enough; otherwise a fresh one is made. The count is the number of samples written, which is what matters, since the buffer may be longer. Every sample format a decoder hands out is read here directly -- planar…
An explicitly owned AVFrame.
Test whether one compatible scalar is at least another.
The maximum of compatible quantities.
Headings, paragraphs, figures and their IDs, mentions, marks.
Multiplication and scalar scaling.
Sample a two-dimensional texture through a sampler at a UV coordinate.
Addition over compatible quantities.
Subtraction or unary negation.
Opening a file's sound and pulling samples out of it.
An
audio-trackis the same pump as avideo-- one demuxer, one decoder,decode-next-frame-- on the file's best audio stream, opened on its own AVFormatContext so a player can run picture and sound on different threads at different rates without either waiting for the other.What comes out is deliberately plain: mono single-floats. A film on a wall is a point in the world; where it sits between the listener's ears is the player's business, not the file's, so channels are folded here and the sample rate is left as the file has it for the output device to resample. There is no swresample in this: interleaving and averaging a few thousand floats a frame is not worth a fifth library.