Failing to Stich

I have been trying to stich a recording but after many attempts following the advice on here I still get the video failing. First it had bad sectors so added the use pyav but now wont even start the process, please help this is frustrating. It takes long enough to process let alone when it fails.

2025-05-23 16:11:13,189 INFO ActionStitch 1.0.4 started
2025-05-23 16:11:21,346 INFO Comparing audios in file 0
2025-05-23 16:11:21,760 WARNING stream 0, timescale not set
2025-05-23 16:11:21,783 WARNING Stream #4: not enough frames to estimate rate; consider increasing probesize
2025-05-23 16:11:23,632 WARNING stream 0, timescale not set
2025-05-23 16:11:23,637 WARNING Stream #4: not enough frames to estimate rate; consider increasing probesize
2025-05-23 16:15:24,030 ERROR failed to read frame 15892 from C:/Users/kevin/Videos/Trials 17-5-25/DJI_001/DJI_20250517110742_0001_D.MP4
2025-05-23 16:17:16,937 INFO feature threshold: 60, count: 5873 8184
2025-05-23 16:17:17,061 INFO feature matches: 2464
2025-05-23 16:17:17,090 INFO refined feature matches: 134
2025-05-23 16:17:17,093 INFO homography: [[0.424836589983097, -0.05260171855776962, 2186.01700958367], [-0.12920679704750246, 0.8359867595452943, 162.2672595586501], [-0.00014564853427874073, -1.126997331869284e-05, 1.0]]
2025-05-23 16:17:17,093 INFO matching diff: 5.79
2025-05-23 16:17:29,492 INFO Use pyav to open video sources
2025-05-23 16:17:29,944 INFO starting at 15656/105247 of C:/Users/kevin/Videos/Trials 17-5-25/DJI_001/DJI_20250517110742_0001_D.MP4
2025-05-23 16:47:37,452 INFO Use pyav to open video sources
2025-05-23 16:47:38,425 INFO starting at 15822/105251 of C:/Users/kevin/Videos/Trials 17-5-25/DJI_002/DJI_20250416025408_0003_D.MP4
2025-05-23 17:14:21,647 INFO writing video file C:/Users/kevin/Videos/Trials 17-5-25.actionstitch\test_0.mp4
2025-05-23 17:15:01,276 INFO 100/3795 0.392 (0.215 0.067 0.014 0.096) 2.64% 0:24:10
2025-05-23 17:15:43,105 INFO 201/3795 0.414 (0.216 0.066 0.014 0.117) 5.30% 0:24:09
2025-05-23 17:15:56,858 ERROR Invalid NAL unit size (1833987408 > 149481).
2025-05-23 17:15:56,858 ERROR Error splitting the input into NAL units.
2025-05-23 17:15:56,865 WARNING Traceback (most recent call last):
2025-05-23 17:15:56,866 WARNING File “as_stitchjob.py”, line 740, in run
2025-05-23 17:15:56,866 WARNING File “as_stitchjob.py”, line 354, in read
2025-05-23 17:15:56,866 WARNING File “as_videosource.py”, line 61, in read
2025-05-23 17:15:56,866 WARNING File “av\container\input.pyx”, line 183, in decode
2025-05-23 17:15:56,866 WARNING File “av\packet.pyx”, line 87, in av.packet.Packet.decode
2025-05-23 17:15:56,866 WARNING File “av\stream.pyx”, line 171, in av.stream.Stream.decode
2025-05-23 17:15:56,866 WARNING File “av\codec\context.pyx”, line 518, in av.codec.context.CodecContext.decode
2025-05-23 17:15:56,866 WARNING File “av\codec\context.pyx”, line 421, in av.codec.context.CodecContext._send_packet_and_recv
2025-05-23 17:15:56,866 WARNING File “av\error.pyx”, line 336, in av.error.err_check
2025-05-23 17:15:56,867 WARNING av.error.InvalidDataError: [Errno 1094995529] Invalid data found when processing input; last error log: [hevc] Error splitting the input into NAL units.
2025-05-23 17:15:57,195 INFO stitch test.mp4: an exception occurred: InvalidDataError(1094995529, ‘Invalid data found when processing input’, None, (16, ‘hevc’, ‘Error splitting the input into NAL units.\n’))
2025-05-24 12:14:25,096 INFO feature threshold: 60, count: 8641 10984
2025-05-24 12:14:25,304 INFO feature matches: 3545
2025-05-24 12:14:25,325 INFO refined feature matches: 259
2025-05-24 12:14:25,326 INFO homography: [[0.34928383288439147, -0.07566278844819724, 2220.2667294333023], [-0.15506037493371708, 0.8012533601172221, 202.32621452333728], [-0.00015936497142275162, -1.8637438288987305e-05, 1.0]]
2025-05-24 12:14:25,326 INFO matching diff: 4.15
2025-05-24 12:15:14,876 INFO Use pyav to open video sources
2025-05-24 12:15:15,698 INFO starting at 64127/105248 of C:/Users/kevin/Videos/Trials 17-5-25/DJI_001/DJI_20250517112515_0002_D.MP4
2025-05-24 14:07:27,626 INFO Use pyav to open video sources
2025-05-24 14:07:28,853 INFO starting at 64289/105252 of C:/Users/kevin/Videos/Trials 17-5-25/DJI_002/DJI_20250416031141_0004_D.MP4
2025-05-24 14:24:25,126 ERROR Invalid NAL unit size (-550379727 > 76682).
2025-05-24 14:24:25,128 ERROR Error splitting the input into NAL units.
2025-05-24 14:24:25,130 WARNING Traceback (most recent call last):
2025-05-24 14:24:25,130 WARNING File “as_stitchjob.py”, line 661, in run
2025-05-24 14:24:25,130 WARNING File “as_stitchjob.py”, line 315, in init
2025-05-24 14:24:25,130 WARNING File “as_videosource.py”, line 65, in grab
2025-05-24 14:24:25,130 WARNING File “as_videosource.py”, line 61, in read
2025-05-24 14:24:25,130 WARNING File “av\container\input.pyx”, line 183, in decode
2025-05-24 14:24:25,130 WARNING File “av\packet.pyx”, line 87, in av.packet.Packet.decode
2025-05-24 14:24:25,130 WARNING File “av\stream.pyx”, line 171, in av.stream.Stream.decode
2025-05-24 14:24:25,130 WARNING File “av\codec\context.pyx”, line 518, in av.codec.context.CodecContext.decode
2025-05-24 14:24:25,130 WARNING File “av\codec\context.pyx”, line 421, in av.codec.context.CodecContext._send_packet_and_recv
2025-05-24 14:24:25,130 WARNING File “av\error.pyx”, line 336, in av.error.err_check
2025-05-24 14:24:25,130 WARNING av.error.InvalidDataError: [Errno 1094995529] Invalid data found when processing input; last error log: [hevc] Error splitting the input into NAL units.
2025-05-24 14:24:25,551 INFO stitch Full Game.mp4: an exception occurred: InvalidDataError(1094995529, ‘Invalid data found when processing input’, None, (16, ‘hevc’, ‘Error splitting the input into NAL units.\n’))

This is the log

This means one of the source videos is corrupted. You can use ffmpeg or handbrake to re-encode the file and that might fix the issue.