trek-view / gopro2gsv

Processes .jpg images and .mp4/.360 videos shot on GoPro MAX or Fusion cameras and uploads to Google Street View.
Apache License 2.0
4 stars 0 forks source link

.360 mode not working #51

Closed himynamesdave closed 9 months ago

himynamesdave commented 9 months ago

Getting the following issue @fqrious with #28

Note, I see the _preprocessing and _processed directories, all with images in.

python3 gopro2gsv.py \
    --input_video tests/360_file/GS019359.360 \
    --extract_fps 0.5 \
    --keep_extracted_frames \
    --output_filepath tests/output/mode4/test1/GS019359.mp4
o tests/360_file/GS019359.360 \
        --extract_fps 0.5 \
        --keep_extracted_frames \
        --output_filepath tests/output/mode4/test1/GS019359.mp4
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] ====================================================
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] =====================GoPro2GSV======================
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] ====================================================
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] Saving log to `/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/tests/output/mode4/test1/GS019359.log`
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] =====================GoPro2GSV======================
30-Nov-23 08:33:41 [GoPro2GSV] [INFO] extracting images
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - tests/360_file/GS019359.360
30-Nov-23 08:36:04 [GoPro2GSV] [INFO] Tagging 76 images
30-Nov-23 08:36:05 [GoPro2GSV] [INFO] Processing video #1 of 1
30-Nov-23 08:36:05 [GoPro2GSV] [INFO] generating gpx file for video #1 at tests/output/mode4/test1/GS019359-1.gpx
30-Nov-23 08:36:05 [GoPro2GSV] [INFO] generating video #1 at tests/output/mode4/test1/GS019359-1_DIRTY.mp4
Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/shell_helper.py", line 39, in run_command_silently
    output = subprocess.check_output(cmd, encoding='utf-8', **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ffmpeg', '-r', '5', '-i', 'tests/output/mode4/test1/GS019359.mp4/_processed/%05d.jpg', '-vframes', '76', '-y', 'tests/output/mode4/test1/GS019359-1_DIRTY.mp4']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/gopro2gsv.py", line 5, in <module>
    main(*parse_args())
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/__main__.py", line 217, in main
    gopro2gsv(args, is_photo_mode, logger)
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/__main__.py", line 178, in gopro2gsv
    videos = process_into_videos(valid_images, TIMELAPSE_FRAME_RATE, args.max_output_video_secs, output_filepath)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/imagetool.py", line 150, in process_into_videos
    create_video_from_images(frame_glob, mp4_file, frame_cursor, end-frame_cursor, frame_rate=framerate, date=first_image['date'])
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/shell_helper.py", line 150, in create_video_from_images
    run_command_silently(cmd, stderr=subprocess.DEVNULL)
  File "/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/src/shell_helper.py", line 44, in run_command_silently
    raise RuntimeError(f"Error running command `{cmd_str}`: {error_message}")
RuntimeError: Error running command `'ffmpeg' '-r' '5' '-i' 'tests/output/mode4/test1/GS019359.mp4/_processed/%05d.jpg' '-vframes' '76' '-y' 'tests/output/mode4/test1/GS019359-1_DIRTY.mp4'`: 
fqrious commented 9 months ago

Please run the command in the error and send ffmpeg output

fqrious commented 9 months ago

fixed

himynamesdave commented 9 months ago

@fqrious all files generated now, but still ends on an error

(gopro2gsv-venv) dgreenwood@Davids-MBP-2 gopro2gsv % python3 gopro2gsv.py \
        --input_video tests/360_file/GS019359.360 \
        --extract_fps 0.5 \
        --keep_extracted_frames \
        --output_filepath tests/output/mode4/test1/GS019359.mp4
o tests/360_file/GS019359.360 \
        --extract_fps 0.5 \
        --keep_extracted_frames \
        --output_filepath tests/output/mode4/test1/GS019359.mp4
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] ====================================================
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] =====================GoPro2GSV======================
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] ====================================================
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] Saving log to `/Users/dgreenwood/Documents/repos/trek-view/gopro2gsv/tests/output/mode4/test1/GS019359.log`
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] =====================GoPro2GSV======================
01-Dec-23 08:04:47 [GoPro2GSV] [INFO] extracting images
01-Dec-23 08:07:10 [GoPro2GSV] [INFO] video `tests/360_file/GS019359.360` split into 77 frames, took 139.795999 seconds
Warning: [minor] The ExtractEmbedded option may find more tags in the media data - tests/360_file/GS019359.360
01-Dec-23 08:07:10 [GoPro2GSV] [INFO] Tagging 77 images
01-Dec-23 08:07:11 [GoPro2GSV] [INFO] Processing video #1 of 1
01-Dec-23 08:07:11 [GoPro2GSV] [INFO] Using frame #0 to #77
01-Dec-23 08:07:11 [GoPro2GSV] [INFO] generating gpx file for video #1 at tests/output/mode4/test1/GS019359-1.gpx
01-Dec-23 08:07:11 [GoPro2GSV] [INFO] generating video #1 at tests/output/mode4/test1/GS019359-1_DIRTY.mp4
01-Dec-23 08:07:24 [GoPro2GSV] [INFO] adding gpmd data stream to video #1 at tests/output/mode4/test1/GS019359-1.mp4
01-Dec-23 08:07:24 [GoPro2GSV] [INFO] copying metadata from first image into tests/output/mode4/test1/GS019359-1.mp4
01-Dec-23 08:07:24 [GoPro2GSV] [INFO] --keep_extracted_frames passed, moving processed frames into `tests/output/mode4/test1/GS019359-images`
01-Dec-23 08:07:24 [GoPro2GSV] [INFO] Post-processing video #1 of 1
01-Dec-23 08:07:24 [GoPro2GSV] [INFO] Video #1 saved at `tests/output/mode4/test1/GS019359-1.mp4`
zsh: command not found: o
fqrious commented 9 months ago

No errors bere, you're running two commands here

As you can see, the error came from ssh, you tried to run

o tests/360_file/GS019359.360 \
        --extract_fps 0.5 \
        --keep_extracted_frames \
        --output_filepath tests/output/mode4/test1/GS019359.mp4

After the actual command, this is not a bug but your mistake

himynamesdave commented 9 months ago

@fqrious i'm an idiot, you're right. Sorry