8.4.0.2. FFmpeg Decoding Interface
(packages/ffmpeg/ffmpeg.lsh)




8.4.0.2.0. (av-open-input-file filename)
(packages/ffmpeg/ffmpeg.lsh)


See: AvInputFile
Open the multimedia file filename using the FFmpeg library and returns an instance of class AvInputFile .



8.4.0.2.1. (av-open-video-source filename)
(packages/ffmpeg/ffmpeg.lsh)


See: VideoSource
See: AvVideoSource
Open the multimedia file filename using the FFmpeg library and returns a AvVideoSource object connected to the first video stream in the file.



8.4.0.2.2. (av-open-audio-source filename)
(packages/ffmpeg/ffmpeg.lsh)


See: AudioSource
See: AvAudioSource
Open the multimedia file filename using the FFmpeg library and returns a AvAudioSource object connected to the first audio stream in the file.



8.4.0.2.3. AvInputFile
(packages/ffmpeg/ffmpeg.lsh)


See: (av-open-input-file filename )
Class AvInputFile is a handle for reading a multimedia file. It is best created using the utility function av-open-input-file . Each multimedia file contains one or more streams. Each stream is either an audio stream or a video stream.

This class defines several useful slots:



8.4.0.2.3.0. (new AvInputFile)
[CLASS] (packages/ffmpeg/ffmpeg.lsh)


Create a new empty instance of class AvInputFile . Calling method open associates this handle with a multimedia file. Various FFmpeg options can be set by defining certain slots of this object before calling open .



8.4.0.2.3.1. (==> avinputfile get-number-of-streams)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Return the total number of streams in the multimedia file.



8.4.0.2.3.2. (==> avinputfile get-stream-codec-type n)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the type of the stream number n . The return value is one of the constants named @CODEC_TYPE_XXX . This includes @CODEC_TYPE_VIDEO or @CODEC_TYPE_AUDIO .



8.4.0.2.3.3. (==> avinputfile get-stream-codec-id n)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the identifier of the codec for stream number n . The return value is one of the constants named @CODEC_ID_XXX .



8.4.0.2.3.4. (==> avinputfile get-format-name)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns a string describing the multimedia file format.



8.4.0.2.3.5. (==> avinputfile get-start-time)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the first presentation time stamp for the multimedia file. Presentation time stamps are real numbers expressed in seconds.



8.4.0.2.3.6. (==> avinputfile get-duration)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the duration of the multimedia file expressed in seconds.



8.4.0.2.3.7. (==> avinputfile open filename)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Associate the empty avinputfile object with the multimedia file named filename . This function checks the file format and the file codecs. It causes an error if the file cannot be decoded by the ffmpeg library.



8.4.0.2.3.8. (==> avinputfile pump)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Method pump reads data from the multimedia file and distributes it to the various streams.



8.4.0.2.4. AvAudioSource
(packages/ffmpeg/ffmpeg.lsh)


See: AudioSource
This subclass of AudioSource provides access to the audio streams of a multimedia file represented by an instance of AvInputFile .

WARNING : Currently, this class is not usable.



8.4.0.2.4.0. (new AvAudioSource avinputfile n)
[CLASS] (packages/ffmpeg/ffmpeg.lsh)


Creates a new AvAudioSource object for accessing stream number n in the multimedia file avinputfile . Stream number n must of course be an audio stream.



8.4.0.2.4.1. (==> avaudiosource get-codec-name)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns a string containing the name of the codec for this audio stream.



8.4.0.2.4.2. (==> avaudiosource get-codec-id)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the identifier of the codec for this audio stream. This function returns one of the @CODEC_ID_XXX constant.



8.4.0.2.4.3. (==> avaudiosource get-start-time)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the first presentation time stamp for this audio stream. Presentation time stamps are real numbers expressed in seconds.



8.4.0.2.4.4. (==> avaudiosource get-duration)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the duration of this audio stream expressed in seconds.



8.4.0.2.5. AvVideoSource
(packages/ffmpeg/ffmpeg.lsh)


See: VideoSource
This subclass of VideoSource provides access to the audio streams of a multimedia file represented by an instance of AvInputFile .

The current frame geometry is available in slots frame-height , frame-width , and frame-aspect-ratio .



8.4.0.2.5.0. (new AvVideoSource avinputfile n)
[CLASS] (packages/ffmpeg/ffmpeg.lsh)


Creates a new AvVideoSource object for accessing stream number n in the multimedia file avinputfile . Stream number n must of course be a video stream.



8.4.0.2.5.1. (==> avvideosource get-codec-name)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns a string containing the name of the codec for this video stream.



8.4.0.2.5.2. (==> avvideosource get-codec-id)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the identifier of the codec for this video stream. This function returns one of the @CODEC_ID_XXX constant.



8.4.0.2.5.3. (==> avvideosource get-start-time)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the first presentation time stamp for this video stream. Presentation time stamps are real numbers expressed in seconds.



8.4.0.2.5.4. (==> avvideosource get-duration)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the duration of this video stream expressed in seconds.



8.4.0.2.5.5. (==> avvideosource get-frame-rate)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the frame rate of this video stream expressed in frames per seconds.



8.4.0.2.5.6. (==> avvideosource get-frame-period)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the delay between consecutive frames expressed in seconds. This is the inverse of the frame rate.



8.4.0.2.5.7. (==> avvideosource get-number-of-frames)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the number of frames estimated from the frame rate and stream duration. This is only an estimate because certain files have variable frame rate, and because certain frames last more than one period.



8.4.0.2.5.8. (==> avvideosource nextframe)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Method nextframe obtains the next video frame. It returns t if a new frame can be accessed, using the frame access methods get-frame-xxx , and returns () when reaching the end of the video stream.

After initializing the video source, this method must be called once in order to access the first video frame.



8.4.0.2.5.9. (==> avvideosource get-frame-pts)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the presentation time stamp of the current frame. The presentation time stamp is a real number expressed in seconds. Calling this function before the first call to nextframe gives the starting time of the movie.



8.4.0.2.5.10. (==> avvideosource get-frame-number)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the presentation frame number of the current frame.



8.4.0.2.5.11. (==> avvideosource get-frame-gray)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the gray level image associated with the current frame as a two dimensional matrix of unsigned bytes.



8.4.0.2.5.12. (==> avvideosource get-frame-rgba)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the RBGA image associated with the current frame as a three dimensional matrix of unsigned bytes. The last dimentsion contains four elements: three color components (R, G, B) and one alpha channel (A).



8.4.0.2.5.13. (==> avvideosource get-frame-yuv)
[MSG] (packages/ffmpeg/ffmpeg.lsh)


Returns the YUV image associated with the current frame as a three dimensional matrix of unsigned bytes. The last dimentsion contains three elements, one per color component (Y, U, V).