# add-captions-to-gif test results, run 2026-11-20 on the live koldflux.com tools (headless Chromium 1280x900, Playwright) and ffmpeg 6/tesseract 5.3.4 on Ubuntu # Sources: horse.gif = Muybridge race horse animation, Wikimedia Commons, public domain (300x200, 15 frames, 10 fps). bbb.gif = 3 s of Big Buck Bunny (CC BY 3.0 Blender Foundation) made with ffmpeg palettegen at 480x270, 10 fps. counter.gif = white 320x180 GIF with frame numbers 1-20. gray.gif/gray300.gif = flat 0x5a6470 controls. ## 1 Chain timings and sizes (gif-to-mp4 -> add-text -> to-gif), seconds = click to download link h-classic-small {"gif_to_mp4":{"secs":3.4,"bytes":74573,"name":"converted.mp4"},"add_text":{"secs":2.7,"bytes":68939,"name":"h-classic-small-1-subtitled.mp4"},"to_gif":{"secs":1.6,"bytes":496963,"name":"h-classic-small-2.gif"}} h-social-small {"gif_to_mp4":{"secs":3.5,"bytes":74573,"name":"converted.mp4"},"add_text":{"secs":2.9,"bytes":69219,"name":"h-social-small-1-subtitled.mp4"},"to_gif":{"secs":1.6,"bytes":492767,"name":"h-social-small-2.gif"}} h-boxed-small {"gif_to_mp4":{"secs":2.8,"bytes":74573,"name":"converted.mp4"},"add_text":{"secs":2.6,"bytes":67911,"name":"h-boxed-small-1-subtitled.mp4"},"to_gif":{"secs":2.1,"bytes":488688,"name":"h-boxed-small-2.gif"}} b-classic-small {"gif_to_mp4":{"secs":5.6,"bytes":214056,"name":"converted.mp4"},"add_text":{"secs":3.2,"bytes":150076,"name":"b-classic-small-1-subtitled.mp4"},"to_gif":{"secs":3.2,"bytes":806153,"name":"b-classic-small-2.gif"}} b-classic-balanced {"gif_to_mp4":{"secs":6.8,"bytes":214056,"name":"converted.mp4"},"add_text":{"secs":3.6,"bytes":150076,"name":"b-classic-balanced-1-subtitled.mp4"},"to_gif":{"secs":4.3,"bytes":2371351,"name":"b-classic-balanced-2.gif"}} b-social-balanced {"gif_to_mp4":{"secs":5.9,"bytes":214056,"name":"converted.mp4"},"add_text":{"secs":3.1,"bytes":149637,"name":"b-social-balanced-1-subtitled.mp4"},"to_gif":{"secs":3.7,"bytes":2353200,"name":"b-social-balanced-2.gif"}} b-boxed-balanced {"gif_to_mp4":{"secs":5.4,"bytes":214056,"name":"converted.mp4"},"add_text":{"secs":3.1,"bytes":148984,"name":"b-boxed-balanced-1-subtitled.mp4"},"to_gif":{"secs":3.4,"bytes":2356385,"name":"b-boxed-balanced-2.gif"}} g-classic-small {"gif_to_mp4":{"secs":2.4,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":2.7,"bytes":2824,"name":"g-classic-small-1-subtitled.mp4"},"to_gif":{"secs":1.7,"bytes":3129,"name":"g-classic-small-2.gif"}} g-classic-balanced {"gif_to_mp4":{"secs":3,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":2.2,"bytes":2824,"name":"g-classic-balanced-1-subtitled.mp4"},"to_gif":{"secs":1.7,"bytes":4830,"name":"g-classic-balanced-2.gif"}} g-social-small {"gif_to_mp4":{"secs":2.4,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":2.6,"bytes":3243,"name":"g-social-small-1-subtitled.mp4"},"to_gif":{"secs":1.7,"bytes":3653,"name":"g-social-small-2.gif"}} g-social-balanced {"gif_to_mp4":{"secs":2.4,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":2.2,"bytes":3243,"name":"g-social-balanced-1-subtitled.mp4"},"to_gif":{"secs":2.2,"bytes":6105,"name":"g-social-balanced-2.gif"}} g-boxed-small {"gif_to_mp4":{"secs":2.4,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":2.6,"bytes":2909,"name":"g-boxed-small-1-subtitled.mp4"},"to_gif":{"secs":1.6,"bytes":5519,"name":"g-boxed-small-2.gif"}} g-boxed-balanced {"gif_to_mp4":{"secs":2.3,"bytes":2241,"name":"converted.mp4"},"add_text":{"secs":3.1,"bytes":2909,"name":"g-boxed-balanced-1-subtitled.mp4"},"to_gif":{"secs":1.7,"bytes":7564,"name":"g-boxed-balanced-2.gif"}} h-none-small {"gif_to_mp4":{"secs":3.9,"bytes":74573,"name":"converted.mp4"},"to_gif":{"secs":2.2,"bytes":537160,"name":"h-none-small-2.gif"}} b-none-small {"gif_to_mp4":{"secs":7,"bytes":214056,"name":"converted.mp4"},"to_gif":{"secs":6.2,"bytes":836176,"name":"b-none-small-2.gif"}} b-none-balanced {"gif_to_mp4":{"secs":7.7,"bytes":214056,"name":"converted.mp4"},"to_gif":{"secs":5.1,"bytes":2604473,"name":"b-none-balanced-2.gif"}} ## 2 Probe of inputs and outputs horse.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=568203 bbb.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=2922194 counter.gif codec_name=gif width=320 height=180 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=20 duration=2.000000 size=14174 b-boxed-balanced-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-classic-balanced-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-classic-small-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-none-balanced-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-none-small-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-social-balanced-1.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 c-classic-1.mp4 codec_name=h264 width=320 height=180 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=20 duration=2.000000 size=6920 h-boxed-small-1.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=74573 h-classic-small-1.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=74573 h-none-small-1.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=74573 h-social-small-1.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=74573 b-boxed-balanced-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=148984 b-classic-balanced-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=150076 b-classic-small-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=150076 b-none-balanced-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-none-small-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=214056 b-social-balanced-2.mp4 codec_name=h264 width=480 height=270 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=149637 c-classic-2.mp4 codec_name=h264 width=320 height=180 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=20 duration=2.000000 size=7940 h-boxed-small-2.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=67911 h-classic-small-2.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=68939 h-none-small-2.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv444p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=74573 h-social-small-2.mp4 codec_name=h264 width=300 height=200 pix_fmt=yuv420p r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=69219 b-boxed-balanced-3.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=12/1 nb_read_frames=36 duration=3.010000 size=2356385 b-classic-balanced-3.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=12/1 nb_read_frames=36 duration=3.010000 size=2371351 b-classic-small-3.gif codec_name=gif width=320 height=180 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=806153 b-none-balanced-3.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=12/1 nb_read_frames=36 duration=3.010000 size=2604473 b-none-small-3.gif codec_name=gif width=320 height=180 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=836176 b-social-balanced-3.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=12/1 nb_read_frames=36 duration=3.010000 size=2353200 c-classic-3.gif codec_name=gif width=320 height=180 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=20 duration=2.000000 size=33810 h-boxed-small-3.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=488688 h-classic-small-3.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=496963 h-none-small-3.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=537160 h-social-small-3.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=492767 b-ff-box.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=2761883 b-ff-naive.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=2074780 b-ff-pal.gif codec_name=gif width=480 height=270 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=30 duration=3.000000 size=2792620 h-ff-box.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=587233 h-ff-naive.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=300805 h-ff-pal.gif codec_name=gif width=300 height=200 pix_fmt=bgra r_frame_rate=10/1 nb_read_frames=15 duration=1.500000 size=591595 ## 3 Known-answer frame counter (OCR of the frame number on every frame, source vs chain output; the digit 8 is not read by OCR in either file) counter.gif: 1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 c-classic-3.gif: 1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 ## 4 Per-frame delays ../src/horse.gif: 15 0.100000 h-classic-small-3.gif: 15 0.100000 h-ff-pal.gif: 15 0.100000 b-classic-small-3.gif: 30 0.100000 b-classic-balanced-3.gif: 23 0.080000 13 0.090000 ## 5 OCR on flat gray control (caption band crop, ocr.sh) g-boxed-balanced-3.gif frames=24 exact=24 meanCER=0.000 g-boxed-small-3.gif frames=20 exact=20 meanCER=0.000 g-classic-balanced-3.gif frames=24 exact=24 meanCER=0.000 g-classic-small-3.gif frames=20 exact=20 meanCER=0.000 g-social-balanced-3.gif frames=24 exact=24 meanCER=0.000 g-social-small-3.gif frames=20 exact=20 meanCER=0.000 ## 6 Font size sweep on flat gray 320x180 (sweep.sh; text_h = height of near-white fill pixels) fontsize=5 text_h=3 frames=10 exact=0 meanCER=0.444 fontsize=6 text_h=4 frames=10 exact=10 meanCER=0.000 fontsize=7 text_h=4 frames=10 exact=10 meanCER=0.000 fontsize=8 text_h=6 frames=10 exact=10 meanCER=0.000 fontsize=9 text_h=6 frames=10 exact=10 meanCER=0.000 fontsize=10 text_h=7 frames=10 exact=10 meanCER=0.000 fontsize=11 text_h=7 frames=10 exact=10 meanCER=0.000 fontsize=12 text_h=8 frames=10 exact=10 meanCER=0.000 fontsize=14 text_h=10 frames=10 exact=10 meanCER=0.000 fontsize=16 text_h=11 frames=10 exact=10 meanCER=0.000 ## 7 OCR on real footage inside the caption box found on the matching gray control (ocr2.py) h-classic-small box=58x14@121,176 frames=15 exact=0 meanCER=0.393 h-none(ctl classic) box=58x14@121,176 frames=15 exact=0 meanCER=0.985 h-social-small box=85x18@108,164 frames=15 exact=1 meanCER=0.237 h-none(ctl social) box=85x18@108,164 frames=15 exact=0 meanCER=0.941 h-boxed-small box=62x20@119,173 frames=15 exact=8 meanCER=0.111 h-none(ctl boxed) box=62x20@119,173 frames=15 exact=0 meanCER=0.948 b-classic-small box=54x14@133,158 frames=30 exact=0 meanCER=0.367 b-classic-balanced box=78x16@201,239 frames=36 exact=0 meanCER=0.349 b-social-balanced box=113x23@184,222 frames=36 exact=7 meanCER=0.139 b-boxed-balanced box=84x26@198,234 frames=36 exact=36 meanCER=0.000 b-none-balanced box=78x16@201,239 frames=36 exact=0 meanCER=0.941 h-ff-box box=173x36@63,158 frames=15 exact=14 meanCER=0.067 b-ff-box box=228x43@126,216 frames=30 exact=30 meanCER=0.000 ## 8 Caption fill height on gray controls (textbox.py) g-classic-small-3.gif 320x180 text_h=5 text_w=45 top=162 pct_h=2.8 g-social-small-3.gif 320x180 text_h=7 text_w=68 top=152 pct_h=3.9 g-boxed-small-3.gif 320x180 text_h=5 text_w=46 top=162 pct_h=2.8 g-classic-balanced-3.gif 480x270 text_h=8 text_w=70 top=243 pct_h=3.0 g-social-balanced-3.gif 480x270 text_h=12 text_w=102 top=227 pct_h=4.4 g-boxed-balanced-3.gif 480x270 text_h=8 text_w=70 top=243 pct_h=3.0 g-ff-pal.gif 480x270 text_h=24 text_w=208 top=226 pct_h=8.9 ## 9 Distinct colors in frame 5 h-ff-pal colors=253 h-ff-naive colors=19 b-ff-pal colors=255 b-ff-naive colors=108 b-classic-balanced-3 colors=255 ## 7b OCR of the large outlined ffmpeg text (palette, no band) inside the box from the matching gray control (ocr2.py) h-ff-pal box=163x29@68,162 frames=15 exact=0 meanCER=0.452 b-ff-pal box=218x36@131,220 frames=30 exact=0 meanCER=0.248 ## 11 ffmpeg one-liner wall time (oneliner.sh rerun to t- prefix; first line palette, second naive) t-h: 0.43 s 0.29 s t-b: 0.73 s 0.63 s ## 10 Loop count in the NETSCAPE2.0 block (0 = loop forever) horse.gif loopcount=0 bbb.gif loopcount=0 h-classic-small-3.gif loopcount=0 h-social-small-3.gif loopcount=0 h-boxed-small-3.gif loopcount=0 b-classic-small-3.gif loopcount=0 b-classic-balanced-3.gif loopcount=0 b-social-balanced-3.gif loopcount=0 b-boxed-balanced-3.gif loopcount=0 c-classic-3.gif loopcount=0 h-ff-box.gif loopcount=0 b-ff-box.gif loopcount=0