Help wanted: identifying the "pyv5" AVI video codec
I have a recording from a security or surveillance camera saved as an AVI file whose video uses a codec with the FourCC pyv5. No player, codec pack, or decoder I know of can play it, and I haven't been able to find the software that made it. This post collects everything I've worked out about the format, in the hope that someone recognises it.
If you know which device, DVR, or software writes pyv5 (or the related yvf5, see below), or you have a player or codec DLL that mentions either string, please get in touch.
The short version
- The AVI container is completely normal. The audio is plain uncompressed PCM and plays fine once extracted.
- The video is a proprietary, frame-by-frame (intra-only), macroblock-based codec with a fixed bitrate of about 42 KB per frame.
- It is not JPEG with the headers stripped, not a disguised H.264/MPEG stream, not simply obfuscated, and not deflate/zlib compressed. I ran an automated brute-force search over all of these possibilities, checked against random-data controls, and nothing came close to matching.
- Without the original decoder, or a recording of a known test image from the same device, the remaining possibilities are too broad to guess.
Container details
| Property | Value |
|---|---|
| Container | RIFF AVI (standard hdrl / movi, no OpenDML) |
| Video FourCC | pyv5 (both the stream handler and biCompression) |
| Resolution | 720 × 576 (PAL) |
| Container frame rate | 25 fps |
| BITMAPINFOHEADER | biBitCount = 24, biSizeImage = 1,244,160 (= 720 × 576 × 3, i.e. the size of an uncompressed frame) |
| Video bitrate | about 3.3–3.7 Mbit/s |
| Audio | PCM, 16-bit, stereo, 12,800 Hz |
Audio. The 12,800 Hz sample rate is exactly 512 samples per 25 fps frame. The left channel is near-silent noise (RMS ≈ 2.5); all the real audio is on the right channel. FFmpeg extracts it without problems.
Frame timing. Most video chunks are empty (0 bytes), meaning "repeat the previous frame". The camera captures at a variable rate. In one 27-second stretch there were about 5 real frames per second, and the full 15-minute recording averages around 10.
Per-frame structure
Every non-empty frame is close to 42 KB (roughly 41,800–42,500 bytes). That near-constant size points to a codec with strict per-frame rate control.
Fixed header (0x00–0x2B)
Every frame begins with the same signature bytes:
81 94 82 8D 83 88 00 05 F3 78 EE ...
Here are the first 0x2C bytes of five consecutive frames:
8194828d83880005f378ee92c7908481b4878304922a0000000000000000ffffffff000000a4000002000000
8194828d83880005f378ee983c3f8481b487830492300000000000000000ffffffff000020a5000002000000
8194828d83880005f378ee9945298481b4878304923a0000000000000000ffffffff000010a4000002000000
8194828d83880005f378ee9c581e8481b4878304923f0000000000000000ffffffff0000d0a3000002000000
8194828d83880005f378ee9ec4f38481b487830492410000000000000000ffffffff000000a5000002000000
- 0x0B–0x0D increase steadily from frame to frame, probably a timestamp.
- 0x15 counts upward, probably a frame counter.
- 0x1E–0x21 are always
FF FF FF FF. - 0x24 holds a uint32 (little-endian) payload length, which is always exactly the chunk size minus 22. This length is always a multiple of 16.
- The rest of the header up to 0x115 is zero.
Table at 0x116
At offset 0x116 there is a table of little-endian uint16 values. Statistics across all 8,680 frames of the full recording:
| Word | Range | Notes |
|---|---|---|
| t0 | 3240 | constant |
| t1 | 494–594 | varies |
| t2 | 3840–4273 | varies |
| t3 | 296–422 | varies |
| t4 | 1342–1598 | varies |
| t5 | 44884–47589 | varies; the value most closely tied to frame size (correlation 0.95) |
| t6 | 0 | constant |
| t7 | 65112–65158 | varies slightly; reads as about −400 if signed |
| t8, t9 | 65535 | constant (0xFFFF) |
| t10 | 15 | constant |
| t11 | 1079–1188 | varies |
| t12 | 1620 | constant |
| t13–t17 | exactly t1–t5 divided by 2 (see below) | |
| t18–t20 | ~2560, ~1132, ~34300 | vary |
The most telling pattern is how t12–t17 relate to t0–t5. In every frame, t12 = t0 / 2, t13 = t1 / 2, and t15 = t3 / 2. Likewise t14, t16 and t17 are t2, t4 and t5 divided by 2 and rounded up to an even number. That is exactly what you'd expect if the same buffer sizes were written twice: once in bytes, and once in 16-bit words padded to 4-byte boundaries.
The constant 1620 is the number of 16×16 macroblocks in a 720×576 frame (45 × 36). So t0 = 3240 bytes would be one 16-bit value per macroblock, such as a quantiser or mode value.
The five variable buffers add up to about 52 KB, more than the compressed frame itself. They are probably intermediate sizes recorded before a final entropy-coding step. No combination of table values predicts the frame size or any internal boundary exactly, so the table can't be used to split the frame into sections.
Payload
- From about offset 0x140, the data is almost perfectly random-looking, about 7.97 bits of entropy per byte, i.e. fully compressed.
- It has no JPEG-style byte stuffing (an
FFbyte is not normally followed by00), and no H.264/MPEG start codes (00 00 01). - Roughly 6.25 KB before the end of every frame there is a block of about 427 raw (uncompressed) signed 16-bit values, all between −600 and +600. Its length barely changes (423–430 values), while its position moves with the frame size. The first part alternates in sign; later values vary smoothly. This is likely side information stored uncompressed.
- That gives a frame layout of at least: header, table, a main compressed section of about 35.5 KB, the raw 16-bit block of about 850 bytes, and a final compressed section of about 5.4 KB.
What has been ruled out
I wrote a brute-force tool that tests families of decoding hypotheses on frames from across the whole recording. For a fair comparison, it runs the identical search on control frames filled with random data.
I checked that the tool works by hiding real JPEG data inside a fake pyv5 frame. It found the exact parameters, decoded every block, and reproduced the hidden picture. So the negative results below are meaningful.
Headerless baseline JPEG with the standard Huffman tables. This covered every start offset in the first 0x200 bytes after the table; MSB- and LSB-first bit order; 16- and 32-bit byte swapping; with and without un-stuffing; 4:2:0, 4:2:2, 4:4:4 and greyscale block layouts; full-frame 720×576 and single-field 720×288; and standard versus luma-only tables. The best attempt decoded 219 of 3,240 blocks before hitting an invalid code, which is no better than random data.
Simple obfuscation of a standard stream. This combined NOT, bit reversal, nibble swap, 16/32-bit swaps, and delta coding with all 256 single-byte XOR keys. Nothing revealed JPEG byte stuffing, JPEG markers, or H.264/MPEG start codes beyond what padding and tables produce.
General-purpose compression. Raw deflate, zlib and gzip produced nothing meaningful at any offset. LZMA and bzip2 also failed in earlier tests.
Relabelling the FourCC. Other people who've seen this format report that changing the FourCC to MJPG, XVID, H.264 and others doesn't help, which fits everything above.
Related format?
There may also be a sibling format. A 2014-era report describes an AVI with FourCC yvf5: 720x528 at 25 fps and 3,719 kbps, with biBitCount 24 and biCompression yvf5. Its header has the same quirks as pyv5: 24-bit depth, biSizeImage equal to width × height × 3, and nearly the same bitrate. A Russian forum thread from around 2018 reportedly asked about yvf5 as well and got no answer. I strongly suspect both come from the same vendor.
What would solve this
Any one of these would very likely crack it:
- The software. The name of the DVR, camera, or video-management software that writes
pyv5oryvf5files. Even better: a player .exe or codec DLL containing either string. With the decoder binary, the format can be reverse-engineered directly, and an open-source decoder could be written. - A known-content recording. A short
pyv5clip of a plain test image, such as a black screen, a white wall, or a test card, recorded on the same kind of device. - More samples. Other
pyv5oryvf5files, especially at different resolutions or quality settings, so the varying fields can be compared.
Useful strings to search for in installers and binaries are pyv5, PYV5, yvf5, YVF5, and the frame signature bytes 81 94 82 8D 83 88.
If you recognise any of this, please leave a comment or get in touch.





