2-channel video file splitter utility for Windows

Post date: May 29, 2015

Some multi-channel dashcams encode their videos into one single file which contains both the front and rear video, as well as the audio. This is fine if the only thing you do is look at the videos in the dashcam company’s proprietary (and sometimes not very good) viewer software. But what if you need to export a clip for use in court, or just to put into your own videos, such as on youtube? Until now, you couldn’t do it very easily. Most videos will play OK in VLC Media Player, but it’s sometimes buggy and hard to work with since it opens each video in its own window, as you can see here:

I have created a script which will make it much easier to break one or more single, combined files into individual files, so you can work with them however you want, using standard video editing software.

Script Updated to v2.1 on February 29, 2016 - Now you can split an entire folder full of videos with just one click! Download the new version if you've used it before, or check out the full article if you haven't!

This script is Windows-only – sorry, mac/linux users. I’m not shunning you; I just don’t know how to write a script that would work for you. That said, DashCamTalk forum member GTA Driver wrote a bash script for use in Linux. Check out that discussion thread. I know FFMPEG exists for both mac and Linux, so if you’re handy, you could probably look at the VBscript I’ve created and make something similar. The command line switches used are probably the same.

This script was originally built and tested on Windows 7 Professional 64bit, but it should work on any version of Windows from Vista to Windows 10 - I have personally tested it (and made new versions) on Windows 10 pro 64bit and had no trouble. It will probably work on XP as well but I can’t say for sure.

Let’s get started. It takes a little bit of prep the first time you use it, since it relies on an external CODEC library/tool called FFmpeg, but it’s very simple to do, and you only have to do it once.

1. Download the script, attached to the end of this post. Save it on your desktop or somewhere convenient, and unzip it. There are only two files inside – a readme.txt and the VideoSplitter script itself.

2. Due to licensing restrictions and to keep the download small, I can’t include FFmpeg in the zip file that contains my script. Downloading it is free and easy though. To get FFmpeg:

a. Go to http://ffmpeg.zeranoe.com/builds/​

b. Even if you have a 64-bit version of Windows, click the link to “Download FFmpeg git-######## 32-bit Static” and save the .7z file in the same place as above.​

c. If you don’t have 7-zip, go to www.7-zip.org to download and install it. It’s free, and handles lots of different archive formats – much better than winzip, IMHO. ​

d. Double-click the 7z file, browse to the Bin folder and extract ffmpeg to the same folder you unzipped the script to. You don’t need to extract everything in the archive, just this one file.​

3. You should now have a folder that contains both “ffmpeg.exe” and “VideoSplitter x.xx by Gibson99.vbs”.

a. If you forgot to put ffmpeg.exe in the same folder as the script, it will tell you when you try to run the script. It will then let you browse to where it’s located. You can run the script that way, but if you plan on running this script more than once, I strongly suggest you copy ffmpeg.exe into the same folder, or it will bug you about it every single time.

4. Make sure you have the dashcam video file(s) to be split available on your computer somewhere. You can put the SD card in your card reader and work with it directly from the card, or you can copy the file from the card/dashcam to your hard drive to make things easier. For this example, I copied files from my SD card to an external hard drive.

5. Double-click “VideoSplitter x.xx by Gibson99.vbs” to start the script. It will ask you if you want to split an entire folder or individual files.

If you click YES it will go to Folder Mode. It's pretty self explanatory, but basically you select a folder full of files you want to split, tell it whether or not you want audio, tell it where to put the split files, and go. I did add a bit of a safeguard here - if you run the script on the same folder more than once, it will prompt you if it finds files that already have "-front" or "-rear" in the filename, which would indicate that they're already split. That way, you don't end up with a bunch of duplicate files. But if for some reason you had a file with "-front" or "-rear" in the name, I'm not going to assume anything - you know better than I do whether you want to split the file, so I give you the option.

This prompt should help avoid creating duplicate files

Once it's finished splitting, the script will show a popup reminding you where the split files were created. Another new feature is that it will now ask you if you want to split more files. Clicking yes will bring you back to the Folder/File mode selection screen you saw when you first started the script.

If you click NO on the first screen, it will go into File Mode. This part of the script is exactly the same as before - the code hasn't changed a bit, so the instructions below still apply.

Click OK and browse to where your dashcam videos are, and select one you want to split. Note that it says “Choose File to Upload” in the title bar, but I promise it’s not uploading anything – this is just a quirk of the standard file browse dialog box that I wasn’t able to change. You can run this script without an internet connection and it will work fine.

6. Do you want to split an additional file? If you click Yes, it will open the Browse window as shown above. In theory you can add as many additional files as you want, but if you add too many, the window shown below will get too tall since it lists all the files you add, and then you won’t be able to click Yes or No. If you click No, it moves on to the next step.

7. Choose a destination – where do you want to put the individual files? If you just click YES, it will put the individual files in the same folder as the last file you selected. If you’re reading directly from the dashcam or its SD card, do not click YES here since there might not be enough space on the SD card, and it could cause issues for the dashcam. If you click NO, you can choose anywhere on your computer (that you have permission to create files) to save them. No matter what, the original file(s) will never be moved, modified, overwritten or deleted by the script.

a. If you choose NO, you will be given a simple folder chooser window. Pick where you want the individual files to be created. Note: Your Desktop is normally located in C:\Users\(Your Username)\Desktop.

8. After selecting a destination, you can select whether or not to include the audio in the individual files. If audio is disabled in your dashcam, I suggest clicking NO, because if you click YES, it will add “+audio” to the filenames of the individual files.

9. We’re almost done! It will confirm the source and destinations, and your audio choice.

10. You will see a DOS window pop up as it splits out the individual streams and creates the new files. The window closes automatically when it’s done.

11. Finally the script lets you know it’s done, and reminds you where to look for the individual files it just created. Clicking OK will close the script.

12. Open the folder you gave as the destination (or if you just clicked YES, open the folder with the last source file you selected) and take a look:

The first file listed above is the original file from the dashcam. The next 2 were created by the script and are pretty self-explanatory based on their filenames. Note that as of version 2.1, the script no longer adds "+audio" to the filename if you tell it to include audio. I figured this was a little redundant.

That's all there is to it! If you find any issues, whether it’s a typo in a dialog box or an actual bug, please let me know by commenting here.

Most importantly – if you try this out on something other than one of the models listed below, please reply to this thread to let us know if it worked. It will be great to know what cameras this script will work for. If it doesn’t work for you, I can try updating the script for you, but I will need a raw dashcam video file from you to be able to do that. You can upload to http://mega.co.nz for free, then post a link to it here so I can work on it as I have time.

Special thanks to @cacherjoe, who got me started with an example command line for ffmpeg, which he had been using to manually split apart his files. Hopefully this script will make it much easier for him and other users with this type of dashcam.

Cameras (and smartphones!) this works with:

  • BlackSys CF-100 - AVI files
  • Innotek Smart-i 3500 HD - AVI files
  • Lukas LK5900- DUO - AVI files
  • Thinkware F550 (Only tested video so far, will test audio later) - AVI files
  • JaewonCNC Iroad Ione 3300ch - MP4 files (support added in v1.02)
  • Cowon Auto Capsule AN2
  • Cowon AF2 - AVI files (thanks Damian for letting me know it works!)
  • Samsung Galaxy S7 (Thanks to Dave Atwater for letting me know it works!)

The script will probably work with other dual-camera devices too!

It was originally written and tested using only files from the CF-100, but it works perfectly with other models without any modification. Just give it a try and don't forget to let us know whether or not it worked for you, so that we can add your camera to this list!

Changelog:

v1.0: 19 Feb 2015

Initial release

v1.01: 20 Feb 2015

Corrected syntax error while deleting temporary batch file at the end of the job when NOT including audio. If you ran 1.0 without including audio, it would leave AVI-Splitter-temp.bat in the destination directory. Running again while including audio would delete the file at the end, or you can simply delete the file yourself - no harm done. Fixed missing file handle close at end of no-audio branch. Also reduced duplicated code within the audio/no-audio SELECT branches.

v1.02: 06 Apr 2015

Added support for JaewonCNC Iroad Ione 3300ch by allowing the script to also inspect MP4 files, not just AVI. I could just remove all file type limitations, but I am limiting the file types it can process so that if someone accidentally selects a non-video file as an input file, ffmpeg doesn't try to do anything crazy. Better safe than sorry. Thus renamed script from AVI Splitter to Video Splitter.

v2.00: 28 May 2015

Major rewrite - now lets you split multiple files at once! Source files (files to be split) do not need to be in the same folder, but individual/split/output files will all be placed in the folder you select. This way you can read them directly from the SD card and create the output files somewhere else, but if you copied them off the SD card already, you can allow it to create the new files in the same folder. Script no longer writes the log file, since I figure nobody really needs that. Also, the script no longer writes the audio-only wav file - again, I don't think people really want that, and when you're splitting lots of files, this lets it finish faster.

v2.1: 29 Feb 2016

Added the ability to split an entire folder full of AVI and MP4 files. Also added a loop to allow the user to split more files after the first batch completes. No longer appends "+audio" to filename when user includes audio.

View the original thread on the DashCamTalk Forum