speedingcheetah
Active Member
- Joined
- Nov 15, 2016
- Messages
- 368
- Reaction score
- 175
- Location
- Twin Cities, MN
- Country
- United States
- Dash Cam
- VIOFO A329T 3CH (Front + Tele + Rear) + Sandisk Extreme 1TB
I use a script and ffmpeg to re-mux/append the dash cams 2 minute video files into a single video file for easy viewing.
I am occasionally having a failure of this process, when it reports a corrupted video file.
When remuxing, it stops when it gets to a problem file.
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Auto-inserting h264_mp4toannexb bitstream filter5x elapsed=0:00:00.50
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Auto-inserting h264_mp4toannexb bitstream filter32x elapsed=0:00:01.54
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Packet corrupt (stream = 0, dts = 9566480).ed= 136x elapsed=0:00:02.05
[h264 @ 00000233be8343c0] Invalid NAL unit size (210904 > 184684).
[h264 @ 00000233be8343c0] missing picture in access unit with size 184688
[concat @ 00000233bcb1de00] h264_mp4toannexb filter failed to receive output packet
[in#0/concat @ 00000233bcb1db80] Error during demuxing: Invalid data found when processing input
[out#0/mp4 @ 00000233bd155c40] video:2232987KiB audio:2737KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.013077%
frame=10306 fps=4277 q=-1.0 Lsize= 2236016KiB time=00:05:43.53 bitrate=53320.7kbits/s speed= 143x elapsed=0:00:02.40
Done
A separate mini bat file i made to just check each file, this is the output error for bad file.
Checking 2025_0928_205655_000209F.MP4...
[h264 @ 0000021c3060cb80] Invalid NAL unit size (210904 > 184684).
[h264 @ 0000021c3060cb80] missing picture in access unit with size 184688
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c2fcddcc0] stream 1, offset 0x2940666c: partial file
[h264 @ 0000021c2fd7e880] Invalid NAL unit size (210904 > 184684).
[h264 @ 0000021c2fd7e880] Error splitting the input into NAL units.
[vist#0:0/h264 @ 0000021c2fce2c80] [dec:h264 @ 0000021c306c5bc0] Decoding error: Invalid data found when processing input
mkvtoolnix also spits a warning.
Quicktime/MP4 reader: Could not read chunk number 3106/3120 with size 210908 from position 691875472. Aborting.
Quicktime/MP4 reader: Could not read chunk number 4854/4874 with size 195 from position 692086380. Aborting.
The video file in this case, is one from the main front camera, and it is the last file before i turn my car off and the cam looses power, and shuts down.
It does not do it all the time, just occasionally. In my testing since i got the cam, it has happened maybe 3 times in total across a couple dozen or so times i have processed footage from the cam.
One of those times was in just 1ch mode, and using internal SD card. But i did not think much of it at the time, and did not save or recall what footage it was with.
At this time, the cam is A329T, is in 3Ch mode, with Viofo SSD cable, connected to Sandisk Extreme 1TB ssd, Both the recommended hardware.
The single file itself plays fine, no noticed issues.
---------
EDIT:
Anyone who wants to have a go and test for themselves, here is a REMUX into one file BASIC.zip containing a simplified version of the remux/appending script I am using.
You would place your same resolution files(like all the files from your drive from Front camera Ch1) in the root folder, and launch the .bat file. It appends the files into one, called output.mp4. If any of the files had an error in the process, it would show in the CLI window, and u will notice that the output video file only contains the footage up to that file that has error. The folder has the ffmpeg.exe included as a hidden file.
Second, Dash Cam Scripts v4.zip, is my full suite at the moment. It has more advanced setup with Input and Output folder. A dedicated script to just do Error Checking of the files. And the refined, cleaner version of my remux script, that also detects what letter the video file ends with, and name the resulting remuxed file based on that. So, F = Front, T = Telephoto, R = Rear. This is customized to my needs and use with the A329T files.
These should work in Windows 11.
Disclosure: These scripts were primarily "vibe coded" using MS Co-Pilot. I do have understanding of Windows batch scripting, and past experience with it, i am just to lazy to make it all from scratch.
If you wish to customize them for your own use, feel free. You can copy the .bat file save it as a .txt doc, and upload that to MS Co-pilot, or Google Gemini etc, and ask it to modify it for your needs.
Like, if you want to replace the Parts that are Telephoto, with Interior, etc.
------
As always, do not just trust and run any scripts you randomly download on the internet.
Open the .bat file in a text editor, or on a sandboxed or Linux machine, to view its contents and what code it is running, if you are concerned about security.
Run with a COPY of your video files first to get familiar with how they work. Always have a backup copy of your data!
--------
LINK to Gdrive. (.zip is too large to post to form)
I am occasionally having a failure of this process, when it reports a corrupted video file.
When remuxing, it stops when it gets to a problem file.
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Auto-inserting h264_mp4toannexb bitstream filter5x elapsed=0:00:00.50
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Auto-inserting h264_mp4toannexb bitstream filter32x elapsed=0:00:01.54
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000233bd4049c0] Packet corrupt (stream = 0, dts = 9566480).ed= 136x elapsed=0:00:02.05
[h264 @ 00000233be8343c0] Invalid NAL unit size (210904 > 184684).
[h264 @ 00000233be8343c0] missing picture in access unit with size 184688
[concat @ 00000233bcb1de00] h264_mp4toannexb filter failed to receive output packet
[in#0/concat @ 00000233bcb1db80] Error during demuxing: Invalid data found when processing input
[out#0/mp4 @ 00000233bd155c40] video:2232987KiB audio:2737KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.013077%
frame=10306 fps=4277 q=-1.0 Lsize= 2236016KiB time=00:05:43.53 bitrate=53320.7kbits/s speed= 143x elapsed=0:00:02.40
Done
A separate mini bat file i made to just check each file, this is the output error for bad file.
Checking 2025_0928_205655_000209F.MP4...
[h264 @ 0000021c3060cb80] Invalid NAL unit size (210904 > 184684).
[h264 @ 0000021c3060cb80] missing picture in access unit with size 184688
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000021c2fcddcc0] stream 1, offset 0x2940666c: partial file
[h264 @ 0000021c2fd7e880] Invalid NAL unit size (210904 > 184684).
[h264 @ 0000021c2fd7e880] Error splitting the input into NAL units.
[vist#0:0/h264 @ 0000021c2fce2c80] [dec:h264 @ 0000021c306c5bc0] Decoding error: Invalid data found when processing input
mkvtoolnix also spits a warning.
Quicktime/MP4 reader: Could not read chunk number 3106/3120 with size 210908 from position 691875472. Aborting.
Quicktime/MP4 reader: Could not read chunk number 4854/4874 with size 195 from position 692086380. Aborting.
The video file in this case, is one from the main front camera, and it is the last file before i turn my car off and the cam looses power, and shuts down.
It does not do it all the time, just occasionally. In my testing since i got the cam, it has happened maybe 3 times in total across a couple dozen or so times i have processed footage from the cam.
One of those times was in just 1ch mode, and using internal SD card. But i did not think much of it at the time, and did not save or recall what footage it was with.
At this time, the cam is A329T, is in 3Ch mode, with Viofo SSD cable, connected to Sandisk Extreme 1TB ssd, Both the recommended hardware.
The single file itself plays fine, no noticed issues.
---------
EDIT:
Anyone who wants to have a go and test for themselves, here is a REMUX into one file BASIC.zip containing a simplified version of the remux/appending script I am using.
You would place your same resolution files(like all the files from your drive from Front camera Ch1) in the root folder, and launch the .bat file. It appends the files into one, called output.mp4. If any of the files had an error in the process, it would show in the CLI window, and u will notice that the output video file only contains the footage up to that file that has error. The folder has the ffmpeg.exe included as a hidden file.
Second, Dash Cam Scripts v4.zip, is my full suite at the moment. It has more advanced setup with Input and Output folder. A dedicated script to just do Error Checking of the files. And the refined, cleaner version of my remux script, that also detects what letter the video file ends with, and name the resulting remuxed file based on that. So, F = Front, T = Telephoto, R = Rear. This is customized to my needs and use with the A329T files.
These should work in Windows 11.
Disclosure: These scripts were primarily "vibe coded" using MS Co-Pilot. I do have understanding of Windows batch scripting, and past experience with it, i am just to lazy to make it all from scratch.
If you wish to customize them for your own use, feel free. You can copy the .bat file save it as a .txt doc, and upload that to MS Co-pilot, or Google Gemini etc, and ask it to modify it for your needs.
Like, if you want to replace the Parts that are Telephoto, with Interior, etc.
------
As always, do not just trust and run any scripts you randomly download on the internet.
Open the .bat file in a text editor, or on a sandboxed or Linux machine, to view its contents and what code it is running, if you are concerned about security.
Run with a COPY of your video files first to get familiar with how they work. Always have a backup copy of your data!
--------
LINK to Gdrive. (.zip is too large to post to form)
Last edited: