[FYT Android Head Units] mjcummins:
Hi People,

I wanted to merge the DVR footage from long trips and get a video file that is significantly sped up, and here's the crude result. Works for my T'eyes CC3, but should work for most FYT units.

Youtube video of resultant file

DashCam_Stitcher.zip <- Contains all executable and the Python script.

FFMPEG & FFPROBE need to be in your PATH for this to work

The program is a command line program, used in the format-> DashCam_Stitcher F 50

Where the source drive from the DVR is at F (in my case)

And the number of times the video footage is sped up is 50 (You can use 1, 2, 10, 100, or whatever)

Only for windows, and only for MP4. Hack my source if you want to change this.

That's the short version if you want to avoid my waffle below.

I driven my wife nuts trying to get this working, and so even though you might think you should thank me, if you do use this please comment with "Thank You Benja"

NOTE: This program will not automatically erase or fix any of your files. If that is needed, the program will prompt you with some helpful hints to fix yourself. I used someone’s demo program and was lucky I had a backup as it wiped my tf card.

Summary

I’ve used Python to script, FFPROBE to find all the corrupt files using a two-pass system, and you will be prompted to use FFMPEG to fix a few of those corrupt files (Or delete). And then automated FFMPEG creating sped up versions of each file in date time stamp order and FFMPEG merged them all into one big video file.

Waffle

If they don’t exist this program will create the following directories

C:\Users\[currentuser]\Videos\DashCam – Where the final merged file appear.

C:\Users\[currentuser]\Videos\DashCam\SpedUp – Where all the individually sped up versions of each file on your TF card will appear.

A sorted list of only the MP4 files is created

A first quick corrupt file check is done on each file using FFPROBE -hide_banner -v error eachfile.mp4. If bad MP4’s are found the program will stop, and ask you to fix them using FFMPEG -i xxxxx.mp4 -c copy xxxxxa.mp4 (or any method you can think of, including deleting the file).

Run dashcam_stitcher again to continue. If no bad files are found, a second much more thorough CPU intensive check is done. The second pass is because I have found files that slip though the first pass, and then kill the merge process at the end.

This second pass uses FFPROBE -show_entries stream=r_frame_rate,nb_read_frames,duration -select_streams v -count_frames -of compact=p=1:nk=1 -threads 3 -v 0 video.mp4

Which on a good file will show stream|25/1|299.000000|7475, but I have found some that cannot be repaired that read as stream|12000/1|131.160000|N/A or similar. If so, program stops again asking you to resolve as before.

Run dashcam_stitcher again to continue. If the video files get through both these checks, each file is then processed and put into the SpedUp folder. Then the program concatenates all the files together in order, and places a uniquely named (based on date and time) video file in the Dashcam folder.

Checking, encoding, and stitching the files together using this program will take a while, but much quicker than doing it by hand.

Again, if you can please comment with "Thank You Benja"