Skip to main content

Crate falcon_ffmpeg

Crate falcon_ffmpeg 

Source
Expand description

falcon’s fallback video decoder: FFmpeg, loaded at run time.

macOS plays mp4, mov and m4v through AVFoundation; Matroska, WebM, AVI, WMV, FLV, Ogg, MPEG-TS and the rest go through FFmpeg instead, as Eagle falls back to its bundled player. falcon never links FFmpeg: the shared libraries are opened with dlopen when first needed (see ffi), so falcon builds and runs without them and only the fallback is missing. The libraries must be an LGPL build, decode and the atempo filter only, such as the one scripts/build-ffmpeg.sh makes; any GPL or nonfree build is refused.

  • probe reads a file’s duration, size and tracks.
  • Grabber decodes single pictures, scaled, for previews; frame_at one picture at full size; thumbnail the import thumbnail.
  • Player plays a file: worker threads decode ahead, the owner takes each frame when it is due, and AudioOut carries the sound to the caller’s audio output, which drives the clock.
  • Tempo changes the sound’s speed and keeps its pitch, as <video> does by default in Eagle’s main player.
  • AudioFile decodes a file’s sound alone, for audio players.

Modules§

ffi
The hand-written FFmpeg surface falcon uses, and the loader that opens the shared libraries at run time.
sync
The player’s timing rules, free of FFmpeg so they can be tested: the wall clock, the audio clock, the queue of decoded frames waiting to be shown, the arithmetic of timestamps and seeks, and the bookkeeping of sound stretched to another speed.
testing
Test clips for falcon’s own tests: AVI files written byte by byte, with uncompressed BGR pictures and 16-bit PCM sound, so no encoder is needed (falcon’s FFmpeg build has none) and every pixel’s value is known. av1 rewraps an AV1 stream encoded elsewhere in WebM, Matroska and MP4.

Structs§

AudioFile
The best sound track of a file as interleaved stereo f32 at 48 kHz.
AudioOut
The sound of a Player: interleaved stereo f32 samples at [OUT_RATE], silence while paused or starved. It ends (returns None) once the player is dropped. Pull it from the audio output’s thread.
Error
Why a file could not be opened or decoded.
Frame
A decoded picture: width * height RGBA pixels, rows top to bottom, fully opaque.
Grabber
Decodes single pictures of one file, scaled to fit a size: for the seek bar’s hover thumbnail, the grid’s hover previews and thumbnails. Usable from any thread.
Info
What probe learns about a file.
Player
A playing file. Lives on the thread that draws it; dropping it stops the workers and ends its AudioOut.
Tempo
Sound going through atempo at one speed.

Constants§

EXTENSIONS
File extensions macOS can’t play that falcon hands to FFmpeg first: Eagle’s video formats outside mp4, mov and m4v (and the 360, afx, vap and eva camera formats, which go to macOS first).

Functions§

available
Whether FFmpeg was found and can be used.
frame_at
The picture at secs at full size.
handles
Whether files with extension ext (any case) go to FFmpeg first.
probe
The facts of a file with a video stream FFmpeg can decode.
status
Whether FFmpeg can be used, and which: Ok with its version string and the folder it was loaded from.
thumbnail
An import thumbnail: the picture where Eagle takes one (sync::thumbnail_time), or the first of a few later ones that is not black, at full size, with the file’s facts and the time used.

Type Aliases§

Result