Expand description
The partial file an output is written to until it is finished, and how a finished one is published.
Every transactional output writes <stem>.a2partial.<ext> beside its final path and
moves it into place only when it finishes. A process killed without unwinding leaves the
partial behind, so liveness is decided by an exclusive advisory lock the writing export
holds, which the OS drops when the process ends. An unheld partial is stale and gets
replaced; a held one is refused.
The claim probes the folder with <stem>.a2probe1.<ext> and <stem>.a2probe2.<ext>:
whether a file can be rewritten at an earlier offset (MP4 index, WAV header) and whether a
rename without replacing works. A folder that cannot rename is refused before rendering;
one that cannot seek (an in-order FUSE mount) gets a staging file in the temporary
directory, copied in once finished.
A finished partial is synced, published by alpha2_os::publish_no_replace (or
alpha2_os::publish_replace), and its folder synced. A finished render is never deleted: a
failed publish moves it to <stem>.a2kept.<ext> (EncodeError::Publish).
When the tag would make a name too long, every sibling becomes
<stem prefix>~<8 hex digits>.<tag>.<ext>, the digits a hash of the final name.
Structs§
- Output
Target - Where an output goes and what it does with a file already there.
- Partial
Output - The partial file of one output from claim to publish or removal: its path, its lock, and any staging file.
- Publish
Report - How a finished output was published.
Enums§
- Existing
Output - What an output does with a file already at its path.
- Seek
Need - Whether a container rewrites earlier bytes (MP4 index, WAV header), which the folder must allow.
Constants§
- PARTIAL_
OUTPUT_ IN_ USE - The prefix of an
EncodeError::OutputInUsemessage, when a live export writes the partial. - PERIODIC_
SYNC_ BYTES - Bytes written between two syncs of an output, so the final sync flushes at most this much and a destination that stops answering is found while writing, by the stall limit.
- PUBLISH_
RETRY_ BUDGET - How long publishing retries while another program holds the target or partial open without sharing deletion (Windows).
Functions§
- partial_
output_ path <stem>.a2partial.<ext>besidefinal_path.- png_
bytes - Straight-alpha 8-bit RGBA
rgbaas the bytes of a PNGwrite_pngwould write. - remove_
stale_ partial_ output - Removes a sibling partial file left by an interrupted transactional export.
- write_
png - Writes straight-alpha 8-bit RGBA
rgbaas a PNG attarget, published whole or not at all likewrite_whole. - write_
whole - Writes a whole file at
target, published only oncewritehas filled the claimed partial, with the same claim, sync and publish as a video output. A write failure removes the partial and leaves the target untouched. The target is checked before writing and again at the rename.