Playing and Converting Dahua NVR’s .dav H264 Videos…

Well, as if fighting the NVR in attempting to export video clips ain’t enough. There’s a need to convert stuff just to play ’em back…

I tried a solution using VideoLAN’s VLC Media Player, but that was a hit-or-miss affair (i.e. sometimes it worked, other times, not).

Enter FFMPEG

FFMPEG

Referencing an answer to a similar question, using FFMPEG is relatively simple:

  • simply re-wrap the H.264 stream into a .mp4 (with the proper headers):
    ffmpeg -y -i input.dav -c copy output.mp4

2020/11/17 Update:
I needed to convert several files and whipped up a simple batch file:

@echo off
FFMPEGPATH="D:\Archive\FFMPEG\64bit\bin"

for %%f in (*.dav) do (
    set f=%f:"=%
    if not exist "%%~nf.mp4" (
        "%FFMPEGPATH:"=%\ffmpeg.exe" -y -i "%%f" -c copy "%%~nf.mp4"
    )
)
  • or try and convert it at the same time (I am using the x265 codec here):
    ffmpeg -y -i input.dav -vcodec libx265 -crf 22 output.mp4

Obviously, re-encoding will take a long time (and unless the encoder is a lot more efficient than the base H.264 codec and/or with lower quality settings) you may end up with a bigger file!

If converting a simple-rewrap will not work for you (or you cannot run FFMPEG), then you could try the next solution…

VideoLAN’s VLC Media Player

To attempt the play any .dav files that you may have (extracted from a Dahua NVR) with VLC Media Player, you will first need to some settings in VLC Media Player first:

  • from the Tools > Preferences… menu option, select “All” radio button under the “Show settings” box (bottom corner left)
  • in the navigation tree on the left, under the “Input/Codecs” section, navigate to and select the “Demuxers” option
  • from the right, change the “Demux module” from “Automatic” to “H264 video demuxer”, then click “Save”

Attempt to play again.

Just remember to undo the changes – otherwise, all other non-H.264 video files will fail to play!

Leave a Reply