Skip to main content

Crate viser_ffmpeg

Crate viser_ffmpeg 

Source
Expand description

FFmpeg/FFprobe wrapper for the viser video-encoding-optimizer workspace.

Provides typed primitives (codecs, resolutions, rate-control modes) plus functions to encode (encode), probe media (probe), and resolve the ffmpeg/ffprobe binary paths. A ProbeCache deduplicates probe calls.

Structs§

EncodeJob
Parameters for a single encode.
EncodeResult
Output of a completed encode.
FfmpegVersion
Parsed FFmpeg version.
FormatInfo
Container-level metadata reported by ffprobe.
ProbeCache
Thread-safe probe result cache to avoid redundant ffprobe calls.
ProbeResult
Parsed result of an ffprobe run: container format plus all streams.
Progress
Real-time encoding progress info parsed from FFmpeg.
Resolution
Video resolution.
StreamInfo
Per-stream metadata reported by ffprobe.

Enums§

Codec
Supported video codec.
ProbeEngine
Backend used to probe media files.
RateControlMode
Rate control mode for encoding.

Constants§

RES_240P
426x240, 16:9.
RES_360P
640x360, 16:9.
RES_480P
854x480 (SD), 16:9.
RES_720P
1280x720 (HD), 16:9.
RES_1080P
1920x1080 (Full HD), 16:9.
RES_1440P
2560x1440 (QHD), 16:9.
RES_2160P
3840x2160 (4K UHD), 16:9.

Functions§

check_ffmpeg
Run ffmpeg -version and parse the version line. Returns an error if the binary is not found or the version is too old.
check_ffprobe
Run ffprobe -version and parse the version line. Returns an error if ffprobe is not found.
concat
Concatenates multiple encoded chunks into a single output without re-encoding.
encode
Runs an FFmpeg encode job. Progress updates are sent on the channel if provided.
extract
Copies a segment of a video file without re-encoding.
ffmpeg_path
Returns the path to the ffmpeg binary.
ffprobe_path
Returns the path to the ffprobe binary.
probe
Runs ffprobe on the given file and returns parsed results.
validate_vmaf_model
Validate that the given VMAF model name is recognized by libvmaf.