[GH-ISSUE #718] Rotated mp4 files are warped in importing with ffmpeg #2313

Closed
opened 2026-03-01 18:55:56 +03:00 by kerem · 0 comments
Owner

Originally created by @JJKylee on GitHub (Sep 11, 2020).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/718

OS: Windows 10 Home x64 19041.508
Program: ScreenToGif 2.27 portable

I recorded my iPad screen in the landscape mode, and the resulting mp4 file has a rotate tag of 270 degrees and a display aspect ratio of 3:4. Any normal player plays it as expected: the video is exactly the same as when it was recorded in the landscape mode.

But while trying to import the mp4 file in ScreenToGif, I found two weird behaviors of ScreenToGif.

  1. FFmpeg rotates the video but the display aspect ratio(DAR) is warped: it still remains 3:4.
  2. MediaPlayer does not respect the rotate tag.

Well, 2) doesn't matter since I can always rotate the frames within ScreenToGif. But 1) is a big problem.

In an attempt to fix this problem, I remuxed the mp4 file with a new DAR tag as follows:

ffmpeg -hide_banner -i INPUT.mp4 -aspect 4:3 -c copy OUTPUT.mp4

But there was no change. ScreenToGif does not respect this new DAR and just rotates the video with a warped aspect ratio as before.

So this time I just removed the rotate tag without aspect ratio change as follows:

ffmpeg -hide_banner -i INPUT.mp4 -c copy -metadata:s:v:0 rotate=0 OUTPUT.mp4

And as expected, this worked the same as 2), and I just needed to rotate the frames in ScreenToGif.

Well, this seems like a bug. Please fix it. Thanks.

Originally created by @JJKylee on GitHub (Sep 11, 2020). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/718 **OS**: Windows 10 Home x64 19041.508 **Program**: ScreenToGif 2.27 portable I recorded my iPad screen in the landscape mode, and the resulting mp4 file has a rotate tag of 270 degrees and a display aspect ratio of 3:4. Any normal player plays it as expected: the video is exactly the same as when it was recorded in the landscape mode. But while trying to import the mp4 file in ScreenToGif, I found two weird behaviors of ScreenToGif. 1) FFmpeg rotates the video but the display aspect ratio(DAR) is warped: it still remains 3:4. 2) MediaPlayer does not respect the rotate tag. Well, 2) doesn't matter since I can always rotate the frames within ScreenToGif. But 1) is a big problem. In an attempt to fix this problem, I remuxed the mp4 file with a new DAR tag as follows: `ffmpeg -hide_banner -i INPUT.mp4 -aspect 4:3 -c copy OUTPUT.mp4` But there was no change. ScreenToGif does not respect this new DAR and just rotates the video with a warped aspect ratio as before. So this time I just removed the rotate tag without aspect ratio change as follows: `ffmpeg -hide_banner -i INPUT.mp4 -c copy -metadata:s:v:0 rotate=0 OUTPUT.mp4` And as expected, this worked the same as 2), and I just needed to rotate the frames in ScreenToGif. Well, this seems like a bug. Please fix it. Thanks.
kerem closed this issue 2026-03-01 18:55:56 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#2313
No description provided.