Opened 6 months ago

Closed 6 months ago

#10684 closed defect (worksforme)

FFmpeg metadata rotate doesn't work since after v2023-05-04-git

Reported by: Melvin Nava Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Melvin Nava)

Summary of the bug:

FFmpeg is no longer able to rotate videos by modifying metadata since after version 2023-05-04-git. That's the last version where that feature worked. I've tried almost every FFmpeg version since that time, without success.

This seems to happen with any input video, so I don't think a sample is required.

How to reproduce:

ffmpeg version 2023-11-20-git-e56d91f8a8-full_build-www.gyan.dev

% ffmpeg -i "source_video.mp4" -c copy -metadata:s:v:0 rotate=90 "destination_video.mp4"
% ffmpeg -i "source_video.mp4" -c copy -metadata:s:v:0 rotate=270 "destination_video.mp4"

I'd appreciate any comments on this..

Change History (4)

comment:1 by Melvin Nava, 6 months ago

Description: modified (diff)

comment:2 by v0lt, 6 months ago

Use the "-display rotation" command.
Description can be found here -> http://ffmpeg.org/ffmpeg-all.html#Video-Options

in reply to:  2 comment:3 by Melvin Nava, 6 months ago

Replying to v0lt:

Use the "-display rotation" command.
Description can be found here -> http://ffmpeg.org/ffmpeg-all.html#Video-Options

I tried it, but got this error at first:

ffmpeg -i "video.mp4" -c copy -display_rotation 270 "video_rotateR.mp4"

Option display_rotation (set pure counter-clockwise rotation in degrees for stream(s)) cannot be applied to output url D:\video_rL.mp4
 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file D:\video_rL.mp4.
Error opening output files: Invalid argument

So I modified the command accordingly, and it now works:

# Rotate video right
ffmpeg -display_rotation 270 -i "video.mp4" -c copy "video_rotateR.mp4"

# Rotate video left
ffmpeg -display_rotation 90 -i "video.mp4" -c copy "video_rotateL.mp4"

Thank you.. I'm closing this ticket!.

comment:4 by Melvin Nava, 6 months ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.