# commands.log: every command the guide publishes, run on the test files and on edge inputs, 2026-11-26 (re-run after verify round 1). Part a ran on a Mac (Python 3.10 with Pillow 10.1), part b on the Ubuntu server (Python 3, ffmpeg 6.1.1 with ffprobe). measure.py compares two flat clips only: on footage or on two flat clips of different grey it prints a full-frame box with exit 0 (see the NOT a valid use lines). published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out1.png 1080 1920 33 192 672 exit=0 test file: the 800 x 300 Fernwick logo, 9:16, slider 33, ad margins 192 right and 672 bottom output: saved tmp-edge/out1.png: 1195x2261 px, visible logo about 197 px wide on the frame| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py tmp-edge/empty.png tmp-edge/out2.png 1080 1920 33 192 672 exit=2 edge: a fully transparent PNG output: the logo is fully transparent: nothing to place| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py tmp-edge/notimage.png tmp-edge/out3.png 1080 1920 33 192 672 exit=2 edge: a text file named .png output: cannot read an image from tmp-edge/notimage.png (UnidentifiedImageError)| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py tmp-edge/nothere.png tmp-edge/out4.png 1080 1920 33 192 672 exit=2 edge: a missing file output: cannot read an image from tmp-edge/nothere.png (FileNotFoundError)| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out5.png 1080 1920 33 20 672 exit=2 edge: distances smaller than the tool's own 3% margin (right 20 px) output: the tool's own 3% margin is already larger than the distance you asked for: no padding needed| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out6.png 1080 1920 10 192 672 exit=2 edge: slider too small for the padding (slider 10) output: slider too small: the padding alone would be as wide as the file; raise the slider above 14.8| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out7.png 1080 1920 wide 192 672 exit=2 edge: a word instead of a number output: frame size, slider, right and bottom must be numbers| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png exit=2 edge: too few arguments output: pad-logo.py |Adds transparent padding to a logo so that, with the Koldflux Add watermark tool set to "Bottom right" and the size slider at|, the visible logo ends from the right edge and from the bottom edge of a| x video. The tool keeps a margin of 3% of the frame width (right) and 3% of the frame height| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png /nonexistent/out.png 1080 1920 33 192 672 exit=2 edge: an unwritable output folder output: cannot write /nonexistent/out.png (FileNotFoundError)| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out8.png 1080 1920 nan 192 672 exit=2 edge: the word nan as the slider output: frame size, slider, right and bottom must be finite numbers| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out9.png 1080 1920 inf 192 672 exit=2 edge: inf as the slider output: frame size, slider, right and bottom must be finite numbers| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out10.png 1080 1920 33 192 1e9 exit=2 edge: an enormous bottom distance (1e9) output: frame size and distances must be 20000 px or less| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out11.png 1080 1920 12 192 672 exit=2 edge: slider 12, the guide's start value, with 192 px on the right output: slider too small: the padding alone would be as wide as the file; raise the slider above 14.8| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out12.png 1080 1920 100 192 672 exit=2 edge: slider 100 (the tool's slider stops at 50) output: the tool's size slider stops at 50| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out13.png 1080 1920 17 192 672 exit=0 edge: slider 17, just above the limit: the file is huge and the mark tiny output: saved tmp-edge/out13.png: 5049x17097 px, visible logo about 24 px wide on the frame| published: python3 pad-logo.py logo.png logo-padded.png 1080 1920 33 192 672 run: python3 pad-logo.py logo-fernwick.png tmp-edge/out14.png 1080 1920 20 192 672 exit=0 edge: slider 20 output: saved tmp-edge/out14.png: 2528x7391 px, visible logo about 56 px wide on the frame| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 out/p0.mp4 exit=0 test file: white 1920 x 1080 clip and the output of the tool (black box logo, Bottom right, 18, 100) output: frame=1920x1080 box=345x129 left=1516 right=59 top=918 bottom=33 mean_src=255.0 mean_out=0.1| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 in/white.mp4 exit=3 edge: source and output identical (no difference) output: no difference found| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 tmp-empty.mp4 exit=2 edge: an empty file output: missing or empty file: tmp-empty.mp4| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 out/nothere.mp4 exit=2 edge: a missing file output: missing or empty file: out/nothere.mp4| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 255 30 50 80 100 exit=0 test file: the sea clip, white logo output: corner mean colour = (106, 117, 143), relative luminance 0.179|logo grey 255 at opacity 30%: contrast ratio 1.72 : 1|logo grey 255 at opacity 50%: contrast ratio 2.37 : 1|logo grey 255 at opacity 80%: contrast ratio 3.59 : 1| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 255 0 exit=2 edge: opacity 0 output: logo grey 0-255, opacity 1-100| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 300 50 exit=2 edge: logo grey above 255 output: logo grey 0-255, opacity 1-100| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/nothere.mp4 255 50 exit=2 edge: a missing file output: missing or empty file: in/nothere.mp4| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py tmp-empty.mp4 255 50 exit=2 edge: an empty file output: missing or empty file: tmp-empty.mp4| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/short.mp4 255 50 exit=3 edge: a clip shorter than 1 s output: no frame read at 1 s (clip shorter than 1 s, or no video stream): | published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 in/whitev.mp4 exit=2 edge: a source and an output of different frame sizes (1920x1080 and 1080x1920) output: sizes differ| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 tmp-notvideo.mp4 exit=2 edge: a text file named .mp4 output: no video stream: tmp-notvideo.mp4| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/short.mp4 in/short.mp4 exit=2 edge: a clip shorter than 1 s (0.52 s) output: could not read a frame at 1 s: in/short.mp4| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/sea.mp4 out/w18.mp4 exit=0 edge: real footage, the sea clip and its watermarked output: NOT a valid use, prints a full-frame box with exit 0 output: frame=1920x1080 box=1920x1080 left=0 right=0 top=0 bottom=0 mean_src=135.3 mean_out=135.9| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom in/white.mp4 in/gray.mp4 exit=0 edge: a flat white and a flat grey clip: NOT a valid use, prints a full-frame box with exit 0 output: frame=1920x1080 box=1920x1080 left=0 right=0 top=0 bottom=0 mean_src=255.0 mean_out=128.0| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py exit=1 edge: no arguments (usage) output: measure.py geom |Reads one frame (1 s in) of both files as 8-bit grey through ffmpeg, finds the box where they differ by more than 12 grey levels and prints|the box size, its four distances to the frame edges and the mean grey inside it for source and output. Standard library plus ffmpeg only.|Exit 2 on a missing or empty file, 3 when no difference is found.| published: ffmpeg -f lavfi -i color=c=white:s=1080x1920:r=25:d=3 -pix_fmt yuv420p flat-white.mp4 run: ffmpeg -y -v error -f lavfi -i color=c=white:s=1080x1920:r=25:d=3 -pix_fmt yuv420p tmp-flat-white.mp4 exit=0 test file: how to make the flat white 1080x1920 test clip the guide tells the reader to use output: | published: ffmpeg -f lavfi -i color=c=white:s=1080x1920:r=25:d=3 -pix_fmt yuv420p flat-white.mp4 run: ffmpeg -y -v error -f lavfi -i color=c=white:s=1080:r=25:d=3 -pix_fmt yuv420p tmp-flat-odd.mp4 exit=234 edge: a frame size typed without a height (s=1080) is refused by ffmpeg output: [Parsed_color_0 @ 0x58ecae67d100] Unable to parse option value "1080" as image size|[Parsed_color_0 @ 0x58ecae67d100] Error setting option s to value 1080.|[AVFilterGraph @ 0x58ecae67b400] Error processing filtergraph: Invalid argument|[in#0 @ 0x58ecae67ad80] Error opening input: Invalid argument| published: python3 measure.py geom source.mp4 watermarked.mp4 run: python3 measure.py geom tmp-flat-white.mp4 tmp-flat-white.mp4 exit=3 test file: the flat clip made with ffmpeg against itself (no mark, so no difference) output: no difference found| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/land.mp4 20 30 100 exit=0 edge: grey 20 on the dark sunset clip output: corner mean colour = (16, 17, 14), relative luminance 0.006|logo grey 20 at opacity 30%: contrast ratio 1.01 : 1|logo grey 20 at opacity 100%: contrast ratio 1.03 : 1| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 255 101 exit=2 edge: opacity 101 output: logo grey 0-255, opacity 1-100| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 abc 50 exit=2 edge: grey abc output: logo grey and opacities must be numbers| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 255 exit=2 edge: no opacity (usage) output: contrast.py [ ...]|Takes the frame 1 s in, cuts the bottom-right corner (the 25% x 15% of the frame where a default-position logo lands), and prints the|WCAG contrast ratio between the blended logo colour and the average colour of that corner, for each opacity. The blend is the plain|alpha blend the tool applies (checked on a flat clip: grey = 255 x (1 - opacity) for a black logo). The logo colour is grey, so R=G=B.| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py tmp-notvideo.mp4 255 50 exit=3 edge: a text file named .mp4 output: no frame read at 1 s (clip shorter than 1 s, or no video stream): [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5e444400bf00] moov atom not found|[in#0 @ 0x5e444400be00] Error opening input: Invalid data| published: python3 contrast.py clip.mp4 255 30 50 80 100 run: python3 contrast.py in/sea.mp4 255 50.5 exit=0 edge: opacity 50.5 (accepted) output: corner mean colour = (106, 117, 143), relative luminance 0.179|logo grey 255 at opacity 50%: contrast ratio 2.38 : 1| published: python3 tables.py run: python3 tables.py exit=0 test file: no input; prints three tables output: Table 1: visible mark width in px, by slider and frame width|slider 390 720 1080 1920 3840| 5% 16 30 45 79 158| 8% 26 48 71 127 253| published: python3 tables.py run: python3 tables.py nonsense exit=0 edge: an unexpected argument (ignored, same three tables as with no argument) output: Table 1: visible mark width in px, by slider and frame width|slider 390 720 1080 1920 3840| 5% 16 30 45 79 158| 8% 26 48 71 127 253|