Aver HD DVR files

Keeping with a standardised format makes dealing with the video much easier.

The rise in HD surveillance video has been pretty rapid, with new implementations appearing on a weekly basis. Considering my first mention of HD was only in December 2012, it is clear that all those extra pixels are coming thick and fast!

This latest implementation to pass through my hands is from from AverMedia. Although the footage is really easy to deal with, there are a few issues worth a mention.

Snap 2013-11-18-22_08_51

Before I get onto the video files, it is worth highlighting a nasty little habit with DVR exports. Along with a folder containing the .dvr files (the video), there is a player (QPlayer.exe), the required .dll files, and then an executable named Instcodec. The alarm bells start to ring with any software that is going to alter my machine so before running anything, lets take a look inside this .exe.

It is a self extracting compressed folder, so using WinRar it’s possible to see what hides inside.

Snap 2013-11-18-22_10_32

And there we have it, it’s a codec install script. The two xvid .dll files end up in the Windows/System32 folder and the codecset.exe logs them in the registry. When the Qplayer is selected, a command window opens and the instcodec.exe is run automatically without asking permission.

It’s worth identifying this type of software. The type that silently installs codecs, dll’s or filters without permission and that have the possibility to screw up a working system. If you do see something, and you want to attempt to run something without it opening the other unknown executables, a good tip is to rename them. I renamed the file to Instcodec.exe.RENAME. The main player ran fine with no new codecs added into my System32 folder.

Now that’s been dealt with, lets get back to the video!

Snap 2013-11-18-22_12_47

Aver’s player interface has not changed much over the years which does make navigating around easy. The first thing to mention within the interface, is the Intelligent Search. A few different companies have started using this but most have it on their main network client and not within an exported player. They have either used something developed in house, or integrated with another developer, such as Briefcam. The method used here works on standard motion detection rather than content analysis.  It allows you to select a specific area on screen such as a doorway and then it bookmarks those times when motion occurs.

Next is the segment and export buttons. I won’t dwell too much on these but basically they allow you to select a part and then export that section as either another .dvr file, an xvid .avi or an mpeg4 video with a .mpg extension. Both the xvid and mpeg4 transcode the footage and as such, can take a considerable amount of time. This time is dependant on the initial recording resolution. And here comes the good part!

There is really no need to use the time consuming built in transcoder. By running the usual video analysis tests it turns out that Aver have retained the h264 standard. FFprobe was used to obtain the details of the video. FFplay was used for a quick preview and then FFmpeg was used to wrap the video inside an avi container. As a jog to your memory…

ffprobe -show_format -show_streams -count_frames -pretty myfile.dvr > myfile.txt

ffprobe -show_frames -print_format xml myfile.dvr > myfile.xml

ffplay -f h264 myfile.dvr

ffmpeg -f h264 -i myfile.dvr -vcodec copy -fflags genpts -r 15 -f avi myfile.avi

It is a lot easier and quicker to just deal with the .dvr file in the first place. Each one is in a camera specific folder and there is one .dvr file for each hour of footage. Its a shame that they did not do the same with the .idx files for the time-code. Perhaps Aver could develop an .idx – .sub converter…… now that would be great!

The footage itself, in this example, had a recorded resolution of 1280 x 1024. The GOP structure mirrored that of the frame rate with 1 I frame and 14 P frames. This was static throughout with no sign of any variation.

Taking everything into consideration, the ability to analyze and deal with the native video out of the player is a huge bonus. This is especially important as the player window opens at 1024 x 768. The recorded footage is actually bigger than the player!

A great format to deal with, however I’m never satisfied! If Aver could only change their player to NOT install anything, and if they created a small index to subtitle converter, there would be a lot of happy video analysts!

 

  

Advertisements
By Spreadys Posted in EEPIP

20 comments on “Aver HD DVR files

  1. I’ve had problems trascoding dvr files with ffmpeg. Apparently the Audio Stream is not detected. Do you, by any chance, run into the same problem, and have a hint on how I can solve this? Thanks in advance !

  2. Hi again..
    without analyzing a file, finding a solution or giving an explanation of why something can’t be done could be quite a challenge. If your .dvr files are from a similar Avermedia system then by using a command similar to those posted at the end of the article should provide a video result. As for the Audio, I do not have an Aver test file with audio included. It is common for manufacturers to use older audio codecs such as G729 and even if the codec is known, it is rare for the manufacturers to document the sample and bitrate.
    Sorry I could not be much more help.
    If you have a small test file that you can allow me to analyze then please send me a link to a dropbox or similar online storage space.
    “share (a) spreadys.com”

    • Hi, did you ever find out what codec/bitrate Aver use for their media? I’m not having much luck using ffprobe to identify the audio stream’s codec and bitrate

      • Hi Ben,
        unfortunately not. The video could be dealt with pretty easily but the audio was completely disguised. As stated in the comment above, using some old teleconferencing codec is quite common. Its probably down to them not having to deal with codec licences. If you manage to crack it, please let me know so I can share with the community.
        All the best and good luck.

      • I suspected as much. ffprobe detects the audio tag as 0000, which isn’t very useful at all.

        I haven’t the time and probably the skills to crack it . As a workaround, I’ve resorted playing the videos back through the Avermedia player and capturing the audio output from that program in real time. Then I have to remux the audio and video.

        Fun.

      • Still no luck over here. Unfortunately we had to drop that feature from our app, and provide support for .avi files only. Anyone tried contacting the guys at Aver ?

  3. Have any of you attempted to open the .dvr file as a “raw” audio file in Sound Forge Pro or Audition, with different settings (e.g., 8-bit PCM/mono/8 kHz, G7.11 A-Law/mono/8 kHz, etc.)? I have had luck with a few different proprietary formats which feature relatively standard audio encoding such as PCM, G.711 mu-law, and G.711 A-law. Opening it as a raw file with the proper settings will assist you with identifying where the multiplexed audio blocks are withing the proprietary file. You can then extract those blocks into a single, concatenated file, open that file again as a “raw” audio file, and save it out to a WAV file.

    Admittedly, if the audio encoding is something other than those available as options in Sound Forge Pro and Audition, then this route won’t work. For more info, refer to a paper I co-wrote titled “Audio Extraction from Silicor Technologies’ Digital Video Recorder File Format” (Journal of Forensic Identification, 60:5:573-588).

  4. That is usually my first port of call! I attempted a number of sample rates and encoding types but couldn’t get any luck in either Audition or Audacity. Its something I must have another crack at when Things get a bit calmer around here!

  5. Hi, this is a great guide. I have been looking for this forever as the built in transcoder is so slow.. I tried this method but I get this error:

    Input #0, h264, from ‘20170123-19.dvr’:
    Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1280×960, 10 fps, 10 tbr, 1200k tbn, 20 tbc
    Output #0, avi, to ‘20170123-19.avi’:
    Metadata:
    ISFT : Lavf57.65.100
    Stream #0:0: Video: h264 (Main) (H264 / 0x34363248), yuv420p(progressive), 1280×960, q=2-31, 10 fps, 10 tbr, 15 tbn, 15 tbc
    Stream mapping:
    Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [avi @ 0000000000e7e940] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
    [avi @ 0000000000e7e940] H.264 bitstream malformed, no startcode found, use the video bitstream filter ‘h264_mp4toannexb’ to fix it (‘-bsf:v h264_mp4toannexb’ option with ffmpeg)
    av_interleaved_write_frame(): Invalid data found when processing input
    frame= 1 fps=0.0 q=-1.0 Lsize= 6kB time=00:00:00.06 bitrate= 706.8kbits/s speed=26.6x
    video:126kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Conversion failed!

  6. Hi David, I’m able to convert the DVR files to mp4 files successfully but the output files are all 1 hour 11 minutes long which may be a problem when these files are used in court. Can you offer any advice?

  7. I’m relatively new at this, and have about 15 of the Aver CCTV systems in different locations. I’ve been looking for a solution that would enable me to transcode the video files – and it looks like this could be it, but I’m not having any luck with the FFmpeg stuff. I’d love to pick your brain if you have time some day. Thanks for the great article! It has helped more than you know!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s