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

Tool to rotate video files #76

Open
kfhdk opened this issue Nov 3, 2022 · 3 comments
Open

Tool to rotate video files #76

kfhdk opened this issue Nov 3, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@kfhdk
Copy link
Contributor

kfhdk commented Nov 3, 2022

Hi,

I made a little tool to rotate video files as the orientatation sometimes is wrong. I mount my gopro upside down on my bike.
It rotates the video by setting metadata in the file.
main...kfhdk:gopro-dashboard-overlay:rotate

@time4tea time4tea added the enhancement New feature or request label Nov 4, 2022
@time4tea
Copy link
Owner

time4tea commented Jan 2, 2023

Thank you for submitting this! - However... could it be simpler just as a ffmpeg command line? Is the python code required? If it were an ffmpeg command line I'd be happy to include it in the docs.

@KyleGW
Copy link
Contributor

KyleGW commented Jan 2, 2023

I've used both ffmpeg and exiftool to accomplish adding the rotation metadata to a file when I forgot to unlock the orientation lock on the gopro, and recorded with it upside down. Note this just adds the rotation metadate which many players will support. Neither of these actually re-encodes the file with a rotation applied to the video stream. If you need to do that, the commands below are not what you need.

ffmpeg command:
ffmpeg -i input.mp4 -map_metadata 0 -metadata:s:v rotate="180" -codec copy output.mp4

exiftool (this will make a copy of the file with the metadata applied:
exiftool.exe -rotation=180 -api LargeFileSupport=1 input.MP4

@bphilli7
Copy link

bphilli7 commented Aug 9, 2024

Add this filter line to an ffmpeg profile will rotate the source video 180 deg during the gopro-dashboard.py rendering step:

"filter": "[0:v]rotate=PI:c=none:ow=rotw(0):oh=roth(0)[rotate0];[rotate0][1:v]overlay",

Adjust the "rotate=PI" argument for other rotation angles (e.g. PI/2)

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

No branches or pull requests

4 participants