Expand description
ffmpeg-backed dialogue treatments. Port of audio_fx.py.
Audio goes through ffmpeg as raw PCM over pipes, exactly as the Python
does: same filter graphs, same argument lists, same trim-or-pad back to
the input length. For a deterministic graph that makes the output bytes
identical; film draws its grain from anoisesrc with ffmpeg’s default
random seed, so no two renders of it — in either language — match.
Failures degrade: a treatment that cannot run leaves the stem as it was
and warns once per (treatment, reason). Setting XIL_STRICT_FX turns
that into an error instead.
Structs§
- Audio
FxError AudioFxError— only raised underXIL_STRICT_FX.- State 🔒
- Treatment
- A named treatment, as written in a cast config
filterfield.
Constants§
- CACHE_
MAX_ 🔒ENTRIES - FIFO-bounded result cache, keyed on the input bytes and every parameter.
- CODEC_
FALLBACK 🔒 - FILM
- PHONE
- SPEAKERPHONE
- STRICT_
ENV_ VAR - TREATMENTS
TREATMENTS, in the order the Python dict is built.- UNTREATED 🔒
Statics§
- STATE 🔒
Functions§
- apply_
treatment apply_treatment(segment, name).- codec_
round_ 🔒trip _codec_round_trip: encode through a lossy codec and decode straight back.- encoder_
available encoder_available(name): doesffmpeg -encoderslist it as a token?- fail 🔒
_fail: warn once with the fallback spelled out, or error when strict.- fit_
length 🔒 _fit_length: trim or pad with silence to exactlytargetbytes.- last_
stderr_ 🔒line - missing_
codecs missing_codecs(names): treatment → encoder, for encoders this ffmpeg lacks.- py_repr
- Python
repr()of astr. - raw_
format 🔒 - ffmpeg’s raw format name for a sample width.
- run_
ffmpeg_ filter run_ffmpeg_filter(segment, graph, label=..., codec=..., ...)withpreserve_length=True.- run_
piped 🔒 - Run a command with
inputon stdin, collecting stdout and stderr, assubprocess.run(..., input=..., capture_output=True)does. - s 🔒
- signal_
code 🔒 - Python reports a signal death as a negative return code.
- treatment
- warn_
once _warn_once(label, reason, message)— the message is already formatted.- with_
state 🔒
Type Aliases§
- Cache
Key 🔒