Skip to content

Reversibility data: big writes, temporary directory, clean Ctrl+C - #562

Merged
JeromeMartinez merged 4 commits into
MediaArea:mainfrom
JeromeMartinez:reversibility-temp-file
Nov 29, 2026
Merged

JeromeMartinez merged 4 commits into
MediaArea:mainfrom
JeromeMartinez:reversibility-temp-file

Conversation

@JeromeMartinez

@JeromeMartinez JeromeMartinez commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

On a network share, the analysis of a DPX sequence was about 25 to 50 files/s instead of hundreds: the reversibility data of each file is written in order, and each small write took 15 to 19 ms on the share, so the analysis was limited to about 50 files/s whatever the count of threads.

  • Reversibility data written by big blocks (4 MiB). A write error is now reported, also when the file is closed (with network storage, some write errors are known only then).
  • Reversibility data file in the temporary directory of the system by default, with the process identifier in its name: no small writes on the network share, and nothing left next to the output if the process is killed. Also with --display-command: the displayed command now ends with && rm of the temporary files (reversibility data file, file lists), as it already did with --output-version 2. Next to the output only if there is no usable temporary directory. -r / --rawcooked-file-name is unchanged.
  • Ctrl+C: clean stop. The analysis stops after the files being parsed, the encoding after the end of FFmpeg (which also receives Ctrl+C), then the reversibility data file is deleted and the output is reported as incomplete if it was being written. Ctrl+C again, or when there is no intermediate file (e.g. during the check), terminates as before. The stop request is in the core (Global.Stop_Requested), so another user interface can use it.
  • Other write errors reported: the beginning of the decoded files (it was not checked), and the --log file (write and close not checked, and a read-only existing file overwritten with -y was silently not written).

Tests: helpers.sh sets the temporary directory to the one of the test suite (deleted at the end) and gets the name of the reversibility data file from the displayed command; the stale reversibility data file checks of reversibilityfile.sh and the long path test provide the file name with -r; vulkan.sh keeps the temporary files for its second variant. run_ffmpeg groups the displayed command so its redirections are for all the commands (with && rm, FFmpeg read the standard input, i.e. the file list of the test).

@JeromeMartinez
JeromeMartinez force-pushed the reversibility-temp-file branch from 4ce1f33 to e75086b Compare November 29, 2026 18:29
Small writes are slow on some network storage, and the reversibility
data of each file was written separately and in order, so the analysis
of the files was limited by the write latency. Write errors are now
reported, also the ones known only when the file is closed.
Default name with the process identifier in the temporary directory of
the system: small writes are slow on some network storage, and nothing
is left next to the output if the process is killed. Also with
--display-command, the displayed command deletes the temporary files
after their use. Next to the output if there is no usable temporary
directory.

The tests set the temporary directory to theirs, get the name of the
file from the displayed command, and redirect the input and outputs of
all the commands of the displayed command.
The analysis stops after the files being parsed and the encoding after
the end of FFmpeg, which also receives Ctrl+C, then the reversibility
data file is deleted and the output file is reported as incomplete if
it was being written. Ctrl+C again, or when no intermediate file exists,
terminates as before. The stop request is in the core, so another user
interface can request it.
A write error of the beginning of a decoded file was ignored. The log
file was written without checking the result, and a log file which could
not be overwritten was not reported.
@JeromeMartinez
JeromeMartinez force-pushed the reversibility-temp-file branch from e75086b to 1fc96cb Compare November 29, 2026 21:31
@JeromeMartinez
JeromeMartinez merged commit d64233a into MediaArea:main Nov 29, 2026
3 checks passed
@JeromeMartinez
JeromeMartinez deleted the reversibility-temp-file branch November 29, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants