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

Manually define framerate of overlay drawn on video #188

Open
Akashic101 opened this issue Mar 7, 2024 · 4 comments
Open

Manually define framerate of overlay drawn on video #188

Akashic101 opened this issue Mar 7, 2024 · 4 comments

Comments

@Akashic101
Copy link

Looking at gopro-dashboard.py it seems like the framerate of the drawn data is hardcoded to be 0.1s

stepper = frame_meta.stepper(timeunits(seconds=0.1 * timelapse_correction))

I would like to render the video at a smoother framerate which I somewhat already achieved with a custom profile where the framerate -r is set to 60, but the drawn data isn't smooth since its stuck at 10fps which especially at the map is very obvious. Is there any way to set the draw-rate to for example 16.66666 (60fps) to achieve a smoother result?

@time4tea
Copy link
Owner

It could be possible to change this... it would make the program quite a bit slower, as it would have to draw the graphics 6x as much, and there would be 6x as many interpolations to calculate (which i guess is not so much).

I can take a look.

@victorlysak
Copy link

victorlysak commented Jul 24, 2024

I'm using this app to render only the overlays to use them later in my videos with Davinci Resolve.
And I'm rendering it as transparent with png codec and in .mov format, and the video comes out as 50 fps.
This maybe helpful to you as my ffmpeg-profiles.json file contains the following lines:
{
"overlay": {
"input": ["-r", "50", "-hwaccel", "auto"],
"output": ["-r", "50", "-vcodec", "png"]
}
}

@time4tea
Copy link
Owner

Hi @victorlysak - thanks for this info.

I think there are two different framerates that are involved in this discussion.. one is the video framerate, which can be easily changed at the moment as you say.

The other is the rate at which the info is drawn, which at the moment is fixed to 10fps.

So for the 50fps example above, each info frame will be repeated 5x.

I've not tried with Resolve but it's possible it doesn't need 50fps info video to overlay onto a 50fps movie. If the mov was rendered at 10fps, it would be quite a bit smaller, although these days disk space not quite so much of a concern.

@victorlysak
Copy link

victorlysak commented Aug 8, 2024

Hi. Big thank you for your work.

It could be 10fps.

But then in Resolve, or probably others, I have to change the video speed to 500% and expand it to full length, so it will be 50fps like the other clips in the project and have the length I need.
But I often forget this :), and begin to cut the clips, then realise that the video is not in sync with the clips and I have to go all the way back to the beginning.

So, currently my ffmpeg-profiles.json file looks like:

{
    "speed-elev": {
      "input": ["-hwaccel", "auto"],
      "output": ["-r", "50", "-vcodec", "qtrle", "-pix_fmt", "argb" ]
    },
    "map": {
      "input": ["-hwaccel", "auto"],
      "filter": "transpose=2",
      "output": ["-r", "50", "-vcodec", "qtrle", "-pix_fmt", "argb", "-vf", "transpose=2"]
    }
}

I changed codec to qtrle because Resolve handles it faster than png, at least for me in Arch Linux.

transpose=2 will rotate map 90 degrees clockwise. As you see, I have to use it twice because if I use it once in either place it won't work.

the xml file for the map looks like this:
<layout> <component type="circuit_map" size="5312" fill="255,123,10" outline_width="0" fill_width="3" /> </layout>

the command line for the above looks like:
/home/vic/venv/bin/gopro-dashboard.py --use-gpx-only --gpx route.gpx --overlay-size 2160x2160 --layout-xml /home/vic/BACKUP/eurodrive/map.xml --profile map gpx-map.mov

one frame from the above video looks like this
mpv-shot0001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants