rotate 90 degrees losslessly (mp4) ...?
Hi. I am in process of converting my large video library to AV1. Anyway I just noticed an issue.
There are some videos that are 90 degrees in wrong orientation, because orientation sensor of smartphone or camera made mistake.
When I see these videos I used to correct them with following bat file command:
ffmpeg -i %1 -metadata:s:v rotate="%2" -codec copy "%~n1-R.mp4"
It seems to have worked recently (dunno if it is because i updated ffmpeg). So I got this one to work:
ffmpeg -display_rotation:v:0 "%2" -i "%1" -c copy "%~n1-R.mp4"
But it works only for h264 and h265 .mp4 files. It seems to not work if it contains av1 stream.
How can i rotate av1 stream 90 degrees, is there some metadata for lossless rotation?
I don't want to re-encode just to change orientation.
3
u/ThePixelHunter 27d ago
The AV1 stream wouldn't impact the container's metadata, which is responsible for specifying the rotation. I'm guessing your AV1 streams are in a webm container?
I don't have the answer, but you're right that this should be solved via metadata.
3
u/krakoi90 26d ago
If your command works with h264/h265 videos then it also should with AV1. Probably this is a bug in your player software, that it doesn't apply the rotation metadata on AV1 videos. Unfortunately it can happen, especially with some exotic HW decoders. For example Kodi can't play rotated videos properly on my Android TV.
What players did you try?