Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request (?): Produce overlay only from GPX file #36

Closed
jacksgt opened this issue May 28, 2022 · 14 comments · Fixed by #67
Closed

Feature request (?): Produce overlay only from GPX file #36

jacksgt opened this issue May 28, 2022 · 14 comments · Fixed by #67
Labels
enhancement New feature or request possibly-fixed Maybe fixed already, but I can't test it or would like confirmation

Comments

@jacksgt
Copy link
Contributor

jacksgt commented May 28, 2022

Hello,

thank you for developing and sharing this tool - the screenshots looks very nice :-)

I was wondering if it's possible to use this tool to render only the overlay video (possibly with a green or transparent background) without an "input* video?

To give some context: I have some footage from camera that doesn't include any (relevant) telemetry metadata.
I also have a separate GPX file based on which I'd like to generate the overlay.
If I had just the overlay video (the length of which would be the same as the GPX recording), I could manually merge it with the actual video footage in another video editing tool (Kdenlive / Shotcut).
I tried the following command, but unfortunately the tool complains that it could not find a metadata stream in the input file (which is true).

gopro-dashboard.py --gpx my.gpx --generate overlay --overlay-size 1920x1080 start.MOV out.mp4

Any help is appreciated :-)

@time4tea
Copy link
Owner

Thanks for your interest! Hmm, this might be possible. The program does already support an "overlay only" mode, but it does currently require a metadata track from a gopro, for synchronisation. I'll take a look at how this could be done. I can't promise it will be done immediately though!

@time4tea
Copy link
Owner

time4tea commented May 28, 2022

Was the video created with a gopro, or is it from someplace else? Just curious, as I thought pretty much all gopro captured metadata- or maybe the metadata got removed somehow?

@jacksgt
Copy link
Contributor Author

jacksgt commented May 28, 2022

Thanks for the super quick reply!

Thanks for your interest! Hmm, this might be possible. The program does already support an "overlay only" mode, but it does currently require a metadata track from a gopro, for synchronisation. I'll take a look at how this could be done. I can't promise it will be done immediately though!

I'm by no means a Python expert and I'm obviously unfamiliar with the code base, but if there is anything I can help with, just let me know.

Was the video created with a gopro, or is it from someplace else? Just curious, as I thought pretty much all gopro captured metadata- or maybe the metadata got removed somehow?

Indeed the video footage was not captured with a GoPro, but with another action camera which doesn't have any built-in GPS metadata.
Here's the ffprobe output:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'start.MOV':
  Metadata:
    major_brand     : iso4
    minor_version   : 1
    compatible_brands: mp42avc1
    creation_time   : 2022-05-15T05:30:00.000000Z
  Duration: 00:04:05.75, start: 0.000000, bitrate: 14119 kb/s
  Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 13984 kb/s, 60 fps, 60 tbr, 60k tbn (default)
    Metadata:
      creation_time   : 2021-11-17T17:51:51.000000Z
      vendor_id       : [0][0][0][0]
      encoder         : AVC Coding
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2021-11-17T17:51:51.000000Z
      vendor_id       : [0][0][0][0]

(even the creation timestamp is messed up because I didn't set the time before recording, haha.)

@time4tea time4tea added the enhancement New feature or request label May 28, 2022
@gokuhs
Copy link

gokuhs commented May 31, 2022

Thanks for your interest! Hmm, this might be possible. The program does already support an "overlay only" mode, but it does currently require a metadata track from a gopro, for synchronisation. I'll take a look at how this could be done. I can't promise it will be done immediately though!

For curiosity, how would it be to generate "overlay only"? Because I see it very useful in order to be able to incorporate it into a video editing program. Thanks!

@jacksgt
Copy link
Contributor Author

jacksgt commented May 31, 2022

For curiosity, how would it be to generate "overlay only"? Because I see it very useful in order to be able to incorporate it into a video editing program. Thanks!

Most video editing programs have a filter called "Chroma Key" (or similar), which basically takes one color in the video and treats it as transparent (this is commonly used for green screens).
Here's a very short tutorial for Shotcut: https://yt.cubieserver.de/watch?v=rbk7yKsWu-k

@time4tea
Copy link
Owner

If you are starting with a GoPro video, you can generate just the overlay by using --generate overlay on the command line. Right now you can't do this with just a gpx file, but maybe soonish.

@time4tea time4tea added the not-planned Its not quite like wontfix, but no current plans to implement, could change label Jul 23, 2022
@time4tea
Copy link
Owner

I thought perhaps its worth chatting about this in #66 ...

ptanov added a commit to ptanov/gopro-dashboard-overlay that referenced this issue Sep 14, 2022
time4tea#64 allow rendering an overlay only video from GPX in an RGBA format
time4tea#66 Creating dashboards with only a GPX file
ptanov added a commit to ptanov/gopro-dashboard-overlay that referenced this issue Sep 15, 2022
time4tea#64 allow rendering an overlay only video from GPX in an RGBA format
time4tea#66 Creating dashboards with only a GPX file
ptanov added a commit to ptanov/gopro-dashboard-overlay that referenced this issue Sep 15, 2022
time4tea#64 allow rendering an overlay only video from GPX in an RGBA format
time4tea#66 Creating dashboards with only a GPX file
ptanov added a commit to ptanov/gopro-dashboard-overlay that referenced this issue Sep 16, 2022
time4tea#64 allow rendering an overlay only video from GPX in an RGBA format
time4tea#66 Creating dashboards with only a GPX file
@time4tea
Copy link
Owner

GitHub magically closed this - not sure it is "closed" yet.

@time4tea time4tea reopened this Sep 24, 2022
@time4tea time4tea added possibly-fixed Maybe fixed already, but I can't test it or would like confirmation and removed not-planned Its not quite like wontfix, but no current plans to implement, could change labels Sep 24, 2022
@jacksgt
Copy link
Contributor Author

jacksgt commented Oct 3, 2022

Wow, thanks for the great work to everyone involved!

I'll take a look at it as soon as possible and will report back how it works and if it fits my use-case.

@time4tea
Copy link
Owner

time4tea commented Oct 3, 2022

Please do let me know if it does or doesn't work for you... the more I understand what people want to do, the more I can make the software do what people want!

@jacksgt
Copy link
Contributor Author

jacksgt commented Oct 9, 2022

Hello,
I just wanted to report back and say that this new feature works exactly as intended - fantastic!

I converted my FIT file to GPX with gpsbabel -i garmin_fit -f "input.fit" -o gpx -F "output.gpx" - so at this point I have a "naked" video file and GPX track.

Then I created the overlay-only video with python3 bin/gopro-dashboard.py --gpx-only --gpx output.gpx --profile overlay --overlay-size 1920x1080 dashboard.mov. I used the png codec of ffmpeg.
Since my GPX track is 5.5 hours long, it produced an overlay video file of 88 GiB :D

Then, I dropped the video files and the new overlay video into Shotcut's timeline and manually aligned the pieces according to the overlay map. Of course, this process is much more tedious than automagically getting the correct position when you have a video file with included GPS data, nevertheless it works quite well when you know the area and there are some landmarks (e.g. specific intersections, houses, ...).

snapshot

Many thanks again for the excellent software! I believe we can close this issue :-)

@time4tea
Copy link
Owner

That is great to hear! Thanks for letting me know and also its great to hear a little about your workflow.

Would it be possible for you to share a frame of the video for our gallery, or if the video is on YouTube or something, a link? - It is 100% ok if you don't want to, but if you do please just send a link or an image to me at gopro-overlay [at] time4tea.net

@time4tea
Copy link
Owner

time4tea commented Dec 9, 2022

@jacksgt I can't remember if I mentioned this already, but in the latest version, you can generate overlays directly from fit files, so no need for the extra conversion step. Cheers!

@jacksgt
Copy link
Contributor Author

jacksgt commented Dec 9, 2022

@time4tea You're awesome man! Nice addition. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request possibly-fixed Maybe fixed already, but I can't test it or would like confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants