Using ffmpeg to convert Wal-Mart security footage

I recently encountered an issue where I needed to convert Wal-Mart security footage. I had ten files with two hours of video in each, which to do a screen-grab conversion probably would have made my computer die a slow and painful death. I had to find a way to convert the footage without using a screen grab.

So I found a post online (duckduck / 20th Nov 2012) that talked about how I needed to edit the file using a hex editor from SN40 to H263. I downloaded a hex editor (HxD) and ran the set up. I went in to the file and modified these two areas.

Once they were changed to H263 the file plays in VLC, but it still had corrupted headers and would not play in any other players. I needed a higher degree of compatibility because I was giving these file to non-technical folks who just needed them to play on a double click.

So once I completed this, I used ffmpeg to convert the file to the same type. I was starting out with an AVI so I converted to an AVI using the simple conversion command line.

C:\> ffmpeg -i filename.avi filename-converted.avi

Running this command on each file (you could use a batch file, if you wish) corrected the corrupt headers. The video would now play in not only VLC but also the Movie viewer in Windows 10 and Windows Media Player.

It’s also fast. I converted 20 hours of video in under 5 minutes. The files were only slightly larger and easily placed on original media for the client to access and play as needed.

Side Effects

So there is one downside to this method: It did not maintain the aspect ratio during playback. The videos are viewable and play smoothly, but they are wider than they would be via the Wal-Mart codec. My intention was to allow the client to view the video and then pick the very specific parts of the video that he wants in the proper aspect ratio.

Once he picked out what he wanted, I would go back and screen grab those bits in the correct aspect ratio and proper format.

Still, the fact that he can now view the video without any issues to pick what part of it he wants without me having to run a screen cap for 20 hours was pretty much worth it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.