This repo contains some experiments that involve encoding arbitrary data into video files that survive Youtube compression. Live demo you can try yourself: https://iancaling.com/steg/ The current solution works 99% of the time and only rarely encounters errors in practice. It works 100% of the time under ideal conditions (i.e. when not round-tripped through Youtube). When encoding some data, each byte is converted to a "tile", which is a rectangle of arbitrary size filled with one of 256 colors. The "palette" used for these colors was specifically tuned to maximize resistance to Youtube's compression. One "frame" of video is made up of as many tiles as will fit. In a 720p (1280x720) video, for example, we can fit 3600 16x16 tiles, or 3.6kB of data. Naturally, this results in video files that take up much more space than the unencoded data. In practice, I generally see a compression ratio of around 1:5-6, meaning the video files are about 5-6x larger than the unencoded data. Here is an encoded frame containing the byte values 0 through 255, following a 13-byte header: This was generated using the command uv run rainbow . It can be decoded using the command uv run decode_frame docs/palette_20250824.png -o output.bin : $ hexdump -C output.bin 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f | ................ | 00000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f | ................ | 00000020 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f | ! " #$%&'()*+,-./| 00000030 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f |0123456789:;<=>?| 00000040 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f |@ABCDEFGHIJKLMNO| 00000050 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f |PQRSTUVWXYZ[\]^_| 00000060 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f | ` abcdefghijklmno | 00000070 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f | pqrstuvwxyz{ | }~. | 00000080 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f | ................ | 00000090 90 91 92 93 94 95 96 97 98 99 9a...
First seen: 2025-10-17 05:51
Last seen: 2025-10-17 09:52