Skip to main content

Module video

Module video 

Source
Expand description

Video Thumbnails

Tuwunel decodes no video itself. An operator-configured program extracts a still frame, which the image thumbnailer then treats as the source picture.

StructsΒ§

Reaper πŸ”’
Kills the program’s process group on every exit that leaves it running, so that a shutdown or a disconnected client takes a wrapper’s descendants with it exactly as an expired deadline does. Disarmed once the child is reaped, past which the identifier could name a group this server never spawned.

ConstantsΒ§

DIAGNOSTIC_LEN πŸ”’
FAILURES πŸ”’
Videos remembered as having failed.
FAILURE_COOLDOWN πŸ”’
How long a video whose extraction failed is left alone. Retrying it at once would spend a slot to fail again, and at the default concurrency of one that is the slot every other video is waiting for.
FAIR_SHARE πŸ”’
Fraction of the deadline the program must still have to be worth running, and to be answerable for missing.
HEIGHT πŸ”’
INPUT πŸ”’
Tokens replaced in every configured argument before each call.
NAME_LENGTH πŸ”’
STAGED πŸ”’
Distinguishes a staged video from anything else in the staging directory, so the startup sweep reclaims only what this module wrote.
VIDEO πŸ”’
Content-type prefix of media a still frame is extracted from.
WIDTH πŸ”’

FunctionsΒ§

drain πŸ”’
kill_group πŸ”’
run πŸ”’
Collect the frame the program writes to standard output, refusing one past the limit rather than decoding a truncation. The program runs in its own process group, so a wrapper overrunning the deadline cannot orphan the work it spawned.
stage πŸ”’
Write the video to a fresh private file: the program needs a seekable input, and a pipe cannot serve formats whose index trails the media.
staging_dir πŸ”’
Videos are staged beside the database rather than in the system temporary directory, which is commonly memory-backed and sized for small files.
substitute πŸ”’
sweep_staging_dir πŸ”’
Reclaim videos staged by a previous run: the scope guard that unlinks them survives neither a kill nor the exec of an in-place restart. Runs during construction, before a request can stage a file this would race, which is also before the service graph exists to read the configuration through.

Type AliasesΒ§

Failures πŸ”’
Videos whose frame extraction failed, against the time it last did. Bounded, since forgetting an entry early only costs a retry.