Monday, 23 November 2026

pyv5 codec mystery...

 

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 FF byte is not normally followed by 00), 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:

  1. The software. The name of the DVR, camera, or video-management software that writes pyv5 or yvf5 files. 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.
  2. A known-content recording. A short pyv5 clip of a plain test image, such as a black screen, a white wall, or a test card, recorded on the same kind of device.
  3. More samples. Other pyv5 or yvf5 files, 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.

Tuesday, 5 December 2017

FFmpeg can open any CCTV video file?

I've heard people say "Can't FFMpeg open anything?" - unfortunately the answer is a firm 'no'.

Although FFMpeg has improved lately, and can open quite a number of tricky formats - it is quite far from being universal. Yesterday I did a test on the latest build of FFMpeg (v3.4) to see how many CCTV formats it can successfully open and convert.

For test data, I used the Kinesense collection of CCTV formats which we have collected over the years from donations from our partners. In the test, FFMpeg successfully converted only 16.5% of CCTV video file formats.

For some background on the issues surrounding weird and wonderful CCTV file formats, take a look at the eForensic's Article I wrote on this topic.

Thursday, 9 June 2016

Interpretation of image and video evidence

The UK's Forensic Science Regulator has published a short useful document on Forensic image comparison and interpretation evidence. Much of what is says should be no surprise to law enforcement and forensic experts who understand video - but its still a useful document as it sets out some points and useful reminders.

Some Highlights:

If the subject to be identified is a substantial distance from the camera or only occupies a small proportion of the image, then the number of pixels that make up the subject may be low. As a result, the level of detail will be very limited and may not be suitable for reliable interpretation. Enlarging an image beyond its resolution will not add additional detail, but will only duplicate existing pixels resulting in a blocky or blurry appearance, depending upon the method of enlargement. The potential for enhancement of low resolution imagery is generally very limited.

There is a great example of how recorder compression artifacts plus 'enhancement' can lead to bad recovery. Based on the enhanced license plate below you may be quite sure the number plate reads DUN 150J, but the real plate is OUM T5GJ.

 Image enhancement should be approached with caution. If you want to know more about what enhancement or clarification can do, check out Kinesense CEO's post on "Video Clarfication: Fact or Fiction". 

Friday, 25 March 2016

Licence Plate Recovery

The good people at VideoCleaner.com have set a 'license plate challenge', saying:

(Note: Doug asked me to block out the actual number plate in this blog post)


Unprecedented... Hmmm... Spready from Amped solved this challenge easily so I thought, I'm sure Kinesense can do this too using our Video Clarification toolkit.

Sure enough, a couple of clicks and the license plate is recovered:



To recover the plate, I used a histogram edit filter (to crop out some of the added noise), temporal median filter to recombine frames, and rotate to correct the orientation. Then I clicked 'histogram equalization' to make it a bit clearer'. About 5 clicks from start to finish.

However, this is clearly not a 'real' license recovery video. By that I mean, the noise 'mode' is artificial and manually added to create the 'license plate challenge', and would never happen in a real video job faced by law enforcement. That said a more realistic video would be solved using the same clarification filters. 

I dug out this example from my archives. It is a read covert surveillance video, in low light with an older analog bullet-cam connected to a commonly used brand of covert surveillance recorder. The issue was caused by the analog camera's auto-gain going too high in low light, and thus adding a huge amount of noise. Running the 'temporal median filter' across the video recovered license plates of any vehicle parked for more than a few minutes in view, or in this screenshot, it recovers the logo on the skip/dumpster.


VideoCleaner set a neat challenge. Recovery under these conditions is not too difficult with the right tools, and its great to see issues like this discussed and highlighted by the community.


Wednesday, 6 May 2015

H264 is a standard, right?

I've written before about the massive issues around the lack of a true video file standard for CCTV (and the lack of any enforcement of existing standards)

I've often heard claims that H264 is a standard format, and you might see this claim from DVR manufacturers. Unfortunately, most DVR makers seem to be endlessly, er, creative, in how they structure their file formats, even while claiming to use 'H264'.

Our PlayerManager application has 94 different players from DVR manufacturers who label their formats as '264' or 'h264'.

Case in point is Swann, who have at least 3 different mutually incompatible versions of 'h264' files. With some effort, FFMpeg can be made to play most of them. The files often include non-standard headers, mystery extra packets, etc, which can trip up even FFMpeg.


Its been a long hope that the CCTV format issue would eventually 'go away' because manufacturers are moving to more standard encoding formats. Unfortunately, this does not appear to be the case. While more and more DVRs will be labelled 'h264' it seems few are rigorously applying this standard, leaving us investigators back at square one.

Monday, 6 October 2014

London Met fail to play CCTV 118,000 times a year

In 2013 the London Metropolitan Police collected CCTV video files in 118,000 criminal cases and were unable to play the video. For robberies, they were only able to play the video collected 13% of the time.

Most police forces don't keep statistics on this - but I am certain the numbers are similar around the world. The real-life result of the chaos in CCTV video file formats, and the lack of standards is a lot of failed convictions.

London Evening Standard: Met failed to check CCTV footage on 118,000 crimes"Met failed to check CCTV footage on 118,000 crimes", 11/12/2013

Wednesday, 28 May 2014

CCTV Formats - The Mystery Filetypes


Our Online Vid-ID Tool has been running now for over 2 years and has been used thousands of times by police around the world. Every now and again, someone enters a file type that the system doesn't have data on. When this happens, I get an email and usually a few minutes googling or checking forums like DME Resources or the FVA mailing lists can uncover information - I then add this to the Vid-ID database. Sometimes though I draw a blank. Here are some of the filetypes I have been unable to identify:

Unknown DVR video file extensions:
.tbl
.tho
.ctarc
.stream
.bu
.mp6
.stw
.sdv
.bsk
.rms
.sv4
.ifo
.vsf4
.pvf
.nsf
.rms
.dat5
.def
.t1
.cvi
.lrxh
.iri
.cdt
.nplx
.ifv
.tag
.ivf
.eflv
.nmd
.svc

If you can help identify anything about these video file formats (DVR manufacturer, make/model, player software, or any other clues), you'll be helping the whole law enforcement community. Please email TechSupport @ Kinesense-vca.com or leave a comment below.