![]() # Python 3, tk, ttk, ffmpeg # draw UI: # title # left: DAV folder, DAV file list, CONVERT button, right: MP4 folder, MP4 file list # progress bar # console/log # on convert: # convert all DAV files to MP4 files (must convert before durations are available) # apply DateTime subtitles to MP4 files # merge adjacent time MP4 files # Version history/roadmap: # V0.1: basic UI to select DAV folder, MP4 folder # V0.2: subprocess ffmpeg to convert DAV to MP4 # V0.3: build DateTime subtitle files # V0.4: merge time-adjacent files from same camera/channel # V0.5: dont make merged videos larger than maximum 2GB # V0.6: handle files w same name same time period _1 suffix but different actual contents # use the larger one but note the exception #V1.0 # V1.0: package into pyinstaller executable, make sure ffmpeg and ffprobe are in path or cwd # V1.1: create 2 log files dav2mp4-log.txt and dav2mp4-debug.txt (w ffmpeg output) # V1.2: checkboxes/settings for partial processing: Dav2Mp4, Merge Mp4s, timestamp subtitles # V1.3: ability to work with BahamaSecurity batch converter. Use Dav2Mp4 to merge the hundreds of small AVIs and subtitle them. Export fails more often than it succeeds with # unhelpful errors such as 'file too small export failed' # (tested with Dahua Smart Player 3.41.0.R.161031 and several other versions) # BahamaSecurity DHAVI Batch Converter 3.34 works pretty well to convert DAV to AVI # It is both faster and converts closer (but not perfect) frame rates/durations # than ffmpeg. The timeline cursor starts # in one area then jumps to another. ![]() When playing video files the times do not match the # filename's encoded times. # Dav2Mp4 # V1.4 - 2017 # GPLv3 license # Convert folder full of surveillance system DAV videos to standard MP4 videos # Works with NVR DAV files with filename convention: # NPV-CH-.DAV # This includes the ICrealtime, Dahua, and other camera systems # Preserve embedded DAV DateTime info by using the filenames and DateTime subtitles # Also merge hundreds of small clips into larger duration MP4 video files # If you are having trouble converting your DAV files using this Dav2Mp4 you may need # to choose the nuclear option: go purchase 'Amped DVRconv' which specializes in # converting security cam video # Note: The original EOM Dahua software, which is white-labelled by every other # manufacturer is terrible. If it’s a big request hire me to take care of your project! Source codeįor the curious, the source code follows: If you have similar needs and want a feature added, email me or comment at the bottom of this page and I’ll add the feature if I can make time. You install it by unzipping the ZIP file into a folder and run it by double-clicking on dav2mp4.exe (Windows only for now, sorry). If all you want to do is USE the program, you can save yourself the trouble of installing Python and the ffmpeg binaries by grabbing the installation package I’ve put together with pyinstaller as a github release. You can grab the source code on Dav2Mp4’s github page. This program is written in Python, and calls ffmpeg to do the video conversion. I recommend using the excellent and free VLC media player to view video and display the subtitles. This program will also merge contiguous video files into single larger MP4 video files. The DAV video files are sometimes broken up into hundreds of small segments showing just a few minutes in each file. It also creates subtitles with the running timestamps to make it clear as you seek and view through the video where you are. After installing DAV software from several different security camera manufacturers I got fed up and wrote this program to convert a large collection of DAV video files into standard MP4 video. The vendor software that works with DAV video is awful to the point of being unusable - crashing constantly, inconsistent seeking and labelling of times, finicky interface that sometimes works and sometimes doesn’t. ![]() I’ve worked on several projects involving video from security cameras, and in most cases the video was stored in the proprietary DAV (Dahua Video) format. I wrote this program to convert DAV videos into standard MP4 video. Many security cameras export video in a proprietary format called DAV which is difficult to work with. Python, forensics, programming, video-editing
0 Comments
Leave a Reply. |