Closed himynamesdave closed 7 months ago
On some videos getting ZeroDivisionError: integer division or modulo by zero error, but cannot understand why
ZeroDivisionError: integer division or modulo by zero
As an example
python3 gopro2gsv.py --extract_fps 2 --keep_extracted_frames --max_output_video_secs 30 --input_video /Volumes/tvhdd2A/BACKUP/trekview/panos/projects/greg-adventures/safari/3-ngorogoro/videos/TZNG028v206vid1/GS014333.mp4 --path_to_nadir stock_nadirs/without_gopro/trek_view_greg_adventures_full_nadir.png --size_of_nadir 25 --output_filepath /Users/dgreenwood/Downloads/gopro2gsv/processed/TZNG028v206vid1/GS014333-trek_view_greg_adventures_full_nadir && \mv /Users/dgreenwood/Downloads/gopro2gsv/processed/TZNG028v206vid1/ /Volumes/tvhdd2A/BACKUP/trekview/panos/projects/greg-adventures/safari/3-ngorogoro/videos/TZNG028v206vid1/processed/
File to recreate is here: https://drive.google.com/file/d/1kyCDTPmqStyTljdWyWW86tAHveWCWCAH/view?usp=drive_link
12-Jan-24 10:20:13 [GoPro2GSV] [INFO] ==================================================== 12-Jan-24 10:20:13 [GoPro2GSV] [INFO] =====================GoPro2GSV====================== 12-Jan-24 10:20:13 [GoPro2GSV] [INFO] ==================================================== 12-Jan-24 10:20:13 [GoPro2GSV] [INFO] Saving log to `/Users/dgreenwood/Downloads/gopro2gsv/processed/TZNG028v206vid1/GS014333-trek_view_greg_adventures_full_nadir.log` 12-Jan-24 10:20:13 [GoPro2GSV] [INFO] =====================GoPro2GSV====================== 12-Jan-24 10:20:13 [GoPro2GSV] [INFO] extracting images Traceback (most recent call last): File "/Users/dgreenwood/Downloads/gopro2gsv/gopro2gsv.py", line 5, in <module> main(*parse_args()) File "/Users/dgreenwood/Downloads/gopro2gsv/src/__main__.py", line 221, in main gopro2gsv(args, is_photo_mode, logger) File "/Users/dgreenwood/Downloads/gopro2gsv/src/__main__.py", line 175, in gopro2gsv valid_images, video_fps, frame_glob = video_to_images(input_vid, output_filepath, framerate=args.extract_fps) File "/Users/dgreenwood/Downloads/gopro2gsv/src/videotool.py", line 119, in video_to_images fps, gps_points, frames = get_gps_data(metadata, framerate) File "/Users/dgreenwood/Downloads/gopro2gsv/src/videotool.py", line 52, in get_gps_data timediff = duration/len(group['data']) ZeroDivisionError: integer division or modulo by zero
The video and GPS looks fine
exiftool -ee -api LargeFileSupport=1 -p gpx.fmt /Volumes/tvhdd2A/BACKUP/trekview/panos/projects/greg-adventures/safari/3-ngorogoro/videos/TZNG028v206vid1/GS014333.mp4> GS014333.gpx
<?xml version="1.0" encoding="utf-8"?> <gpx version="1.0" creator="ExifTool 12.67" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd"> <trk> <number>1</number> <trkseg> <trkpt lat="-3.2299952" lon="35.5392496"> <ele>1752.204</ele> <time>2023-09-15T09:36:09.180Z</time> </trkpt> <trkpt lat="-3.2300025" lon="35.5392364"> <ele>1752.191</ele> <time>2023-09-15T09:36:11.160Z</time> </trkpt> <trkpt lat="-3.230016" lon="35.5392161"> <ele>1752.162</ele> <time>2023-09-15T09:36:11.930Z</time> </trkpt> <trkpt lat="-3.2300312" lon="35.5391884"> <ele>1752.044</ele> <time>2023-09-15T09:36:12.810Z</time> </trkpt> <trkpt lat="-3.2300619" lon="35.5391132"> <ele>1751.77</ele> <time>2023-09-15T09:36:15.065Z</time> </trkpt> <trkpt lat="-3.2300709" lon="35.5390919"> <ele>1751.751</ele> <time>2023-09-15T09:36:15.615Z</time> </trkpt> <trkpt lat="-3.230091" lon="35.5390466"> <ele>1751.652</ele> <time>2023-09-15T09:36:17.045Z</time> </trkpt> <trkpt lat="-3.2301092" lon="35.5390023"> <ele>1751.48</ele> <time>2023-09-15T09:36:18.420Z</time> </trkpt> <trkpt lat="-3.2301544" lon="35.5389106"> <ele>1751.228</ele> <time>2023-09-15T09:36:18.915Z</time> </trkpt> <trkpt lat="-3.2301727" lon="35.5388781"> <ele>1751.111</ele> <time>2023-09-15T09:36:20.345Z</time> </trkpt> <trkpt lat="-3.2302085" lon="35.5388216"> <ele>1750.95</ele> <time>2023-09-15T09:36:20.950Z</time> </trkpt> <trkpt lat="-3.2302288" lon="35.5387909"> <ele>1750.825</ele> <time>2023-09-15T09:36:22.490Z</time> </trkpt> <trkpt lat="-3.230273" lon="35.5387193"> <ele>1750.665</ele> <time>2023-09-15T09:36:22.985Z</time> </trkpt> <trkpt lat="-3.2302871" lon="35.538689"> <ele>1750.585</ele> <time>2023-09-15T09:36:24.580Z</time> </trkpt> <trkpt lat="-3.2303087" lon="35.5386247"> <ele>1750.615</ele> <time>2023-09-15T09:36:25.020Z</time> </trkpt> <trkpt lat="-3.2303191" lon="35.5385399"> <ele>1750.646</ele> <time>2023-09-15T09:36:26.010Z</time> </trkpt> <trkpt lat="-3.2303184" lon="35.5384827"> <ele>1750.549</ele> <time>2023-09-15T09:36:27.000Z</time> </trkpt> <trkpt lat="-3.2303123" lon="35.5384304"> <ele>1750.411</ele> <time>2023-09-15T09:36:28.375Z</time> </trkpt> <trkpt lat="-3.2302991" lon="35.5383512"> <ele>1750.331</ele> <time>2023-09-15T09:36:28.925Z</time> </trkpt> <trkpt lat="-3.2302851" lon="35.5382917"> <ele>1750.256</ele> <time>2023-09-15T09:36:28.925Z</time> </trkpt> <trkpt lat="-3.2302657" lon="35.5382152"> <ele>1750.17</ele> <time>2023-09-15T09:36:30.960Z</time> </trkpt> <trkpt lat="-3.2302503" lon="35.5381643"> <ele>1750.05</ele> <time>2023-09-15T09:36:31.730Z</time> </trkpt> <trkpt lat="-3.2302154" lon="35.5380558"> <ele>1749.885</ele> <time>2023-09-15T09:36:33.050Z</time> </trkpt> <trkpt lat="-3.2301925" lon="35.5379909"> <ele>1749.798</ele> <time>2023-09-15T09:36:34.040Z</time> </trkpt> <trkpt lat="-3.2301823" lon="35.5379577"> <ele>1749.789</ele> <time>2023-09-15T09:36:35.800Z</time> </trkpt> <trkpt lat="-3.2301495" lon="35.5378595"> <ele>1749.68</ele> <time>2023-09-15T09:36:36.295Z</time> </trkpt> <trkpt lat="-3.2301116" lon="35.5377444"> <ele>1749.707</ele> <time>2023-09-15T09:36:37.450Z</time> </trkpt> <trkpt lat="-3.2300967" lon="35.5376976"> <ele>1749.62</ele> <time>2023-09-15T09:36:38.000Z</time> </trkpt> <trkpt lat="-3.2300788" lon="35.537638"> <ele>1749.594</ele> <time>2023-09-15T09:36:39.155Z</time> </trkpt> <trkpt lat="-3.2300683" lon="35.5376023"> <ele>1749.612</ele> <time>2023-09-15T09:36:39.870Z</time> </trkpt> <trkpt lat="-3.230048" lon="35.5375322"> <ele>1749.581</ele> <time>2023-09-15T09:36:41.135Z</time> </trkpt> <trkpt lat="-3.2300432" lon="35.537511"> <ele>1749.567</ele> <time>2023-09-15T09:36:41.905Z</time> </trkpt> <trkpt lat="-3.2300358" lon="35.5374817"> <ele>1749.538</ele> <time>2023-09-15T09:36:43.555Z</time> </trkpt> <trkpt lat="-3.2300285" lon="35.5374576"> <ele>1749.565</ele> <time>2023-09-15T09:36:44.105Z</time> </trkpt> <trkpt lat="-3.2300207" lon="35.5374306"> <ele>1749.567</ele> <time>2023-09-15T09:36:45.040Z</time> </trkpt> <trkpt lat="-3.2300168" lon="35.5374192"> <ele>1749.46</ele> <time>2023-09-15T09:36:45.975Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.537413"> <ele>1749.466</ele> <time>2023-09-15T09:36:47.295Z</time> </trkpt> <trkpt lat="-3.2300141" lon="35.5374129"> <ele>1749.376</ele> <time>2023-09-15T09:36:48.615Z</time> </trkpt> <trkpt lat="-3.230014" lon="35.5374128"> <ele>1749.361</ele> <time>2023-09-15T09:36:49.000Z</time> </trkpt> <trkpt lat="-3.230014" lon="35.537413"> <ele>1749.366</ele> <time>2023-09-15T09:36:50.430Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374132"> <ele>1749.349</ele> <time>2023-09-15T09:36:50.925Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374133"> <ele>1749.347</ele> <time>2023-09-15T09:36:51.915Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.5374133"> <ele>1749.349</ele> <time>2023-09-15T09:36:53.235Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374134"> <ele>1749.302</ele> <time>2023-09-15T09:36:54.170Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374134"> <ele>1749.31</ele> <time>2023-09-15T09:36:54.885Z</time> </trkpt> <trkpt lat="-3.2300141" lon="35.5374136"> <ele>1749.335</ele> <time>2023-09-15T09:36:55.985Z</time> </trkpt> <trkpt lat="-3.2300141" lon="35.5374136"> <ele>1749.302</ele> <time>2023-09-15T09:36:57.030Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374139"> <ele>1749.375</ele> <time>2023-09-15T09:36:58.185Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.5374138"> <ele>1749.367</ele> <time>2023-09-15T09:36:58.955Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.5374139"> <ele>1749.395</ele> <time>2023-09-15T09:37:00.055Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.5374141"> <ele>1749.413</ele> <time>2023-09-15T09:37:01.100Z</time> </trkpt> <trkpt lat="-3.2300143" lon="35.5374142"> <ele>1749.441</ele> <time>2023-09-15T09:37:01.925Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374144"> <ele>1749.472</ele> <time>2023-09-15T09:37:02.860Z</time> </trkpt> <trkpt lat="-3.2300141" lon="35.5374144"> <ele>1749.531</ele> <time>2023-09-15T09:37:03.960Z</time> </trkpt> <trkpt lat="-3.2300142" lon="35.5374145"> <ele>1749.544</ele> <time>2023-09-15T09:37:05.060Z</time> </trkpt> <trkpt lat="-3.2300144" lon="35.5374145"> <ele>1749.588</ele> <time>2023-09-15T09:37:06.000Z</time> </trkpt> <trkpt lat="-3.2300141" lon="35.5374149"> <ele>1749.593</ele> <time>2023-09-15T09:37:07.150Z</time> </trkpt> <trkpt lat="-3.2300139" lon="35.5374151"> <ele>1749.597</ele> <time>2023-09-15T09:37:08.030Z</time> </trkpt> <trkpt lat="-3.2300137" lon="35.5374153"> <ele>1749.593</ele> <time>2023-09-15T09:37:09.240Z</time> </trkpt> <trkpt lat="-3.2300136" lon="35.5374155"> <ele>1749.635</ele> <time>2023-09-15T09:37:10.065Z</time> </trkpt> <trkpt lat="-3.2300137" lon="35.5374154"> <ele>1749.667</ele> <time>2023-09-15T09:37:11.165Z</time> </trkpt> <trkpt lat="-3.2300138" lon="35.5374154"> <ele>1749.685</ele> <time>2023-09-15T09:37:12.045Z</time> </trkpt> <trkpt lat="-3.2300136" lon="35.537415"> <ele>1749.656</ele> <time>2023-09-15T09:37:13.035Z</time> </trkpt> <trkpt lat="-3.2300136" lon="35.5374148"> <ele>1749.67</ele> <time>2023-09-15T09:37:13.970Z</time> </trkpt> </trkseg> </trk> </gpx>
On some videos getting
ZeroDivisionError: integer division or modulo by zero
error, but cannot understand whyAs an example
File to recreate is here: https://drive.google.com/file/d/1kyCDTPmqStyTljdWyWW86tAHveWCWCAH/view?usp=drive_link
The video and GPS looks fine