News:

--

Main Menu

video rotated in avidemux but normal in players

Started by anctop, February 24, 2021, 04:18:51 AM

Previous topic - Next topic

anctop

I received some .mp4 videos which are said to be created with the default screen recording app on an iPad in portrait orientation.

The files play correctly on players (e.g. VLC), but they are rotated 90 degrees anticlockwise when opened with avidemux.
If the files are saved again with avidemux, then the resultants are also rotated on other players.

It appears that these files may contain metadata which are ignored by avidemux.

Can this problem be solved ?

eumagga0x2a

By design, the preview in Avidemux always displays video as-is, without applying transformations hinted by metadata like rotation or display width adjustments for not square pixel (anamorphosis). You need to specify the needed rotation in the configuration of the MP4 muxer.

guyr

New Avidemux 2.7.8 user.  Thank you very much for this great software.  I tried 4 or 5 other programs before finding Avidemux.  I have very basic needs for editing videos: rotating and cutting.  Avidemux has just the right mix of functionality and ease of use for me.

I took a video in portrait mode on my phone, and that shows sideways on my PC - rotated 90 degrees counterclockwise.  I was able to fix that by applying the rotate filter to Video Output.  I wanted to save back in the original format - MP4.  So I set Output Format to MP4Muxer, then noticed a rotate setting in the Configure settings for MP4Muxer.  I set that and reset the rotate filter on Video Output.  But the resulting video was not rotated (tested in Windows Media Player.)

I'm not understanding when the rotate functionality of the MP4Muxer comes into play.  My limited experience is that only the rotate filter of the Video Output actually changes the orientation of the resulting video.

Thanks.

butterw

- mp4 container metadata rotate flags doesn't require re-encode, but may or may not be supported by applications (ex: Avidemux doesn't apply it).
- Avidemux Rotate filter requires the output to be re-encoded but the result will be 100% supported.
- On my system, Windows Media Player does support the mp4 flag (set with ffmpeg) as do all major video players. Windows Media Player isn't the most reliable player, so you may want to try other players such as Mpc-hc, mpc-be, mpv to confirm.

eumagga0x2a: Could Avidemux detect the container rotation flag value ?

eumagga0x2a

Quote from: butterw on May 18, 2021, 10:17:12 AM- On my system, Windows Media Player does support the mp4 flag (set with ffmpeg)

Does it mean that WMP ignores rotation metadata set by the MP4 muxer in Avidemux? (I can hardly imagine that this is the case as both use libavformat for the task.)

Quote from: butterw on May 18, 2021, 10:17:12 AMCould Avidemux detect the container rotation flag value ?

It could, but for what kind of benefit? The single use case would be saving uniformly rotated mp4 videos using the MP4 muxer as no other muxer supports this feature, which would trigger a lot of complaints about "broken" muxers.

butterw

Most videos are mp4/mov.

If a video with rotation flag is manually loaded it's obvious immediately. But for batch processing via script, detecting and handling the rotation could be useful (either saving the rotation parameter in mp4 for lossless editing or applying the correct rotation filter for re-encode).

The same approach could be useful for container DAR which can be used in mp4 or mkv, which is often not so obvious to detect.

As a suggestion the rotate filter description should also mention Rotate (Clockwise) instead of just Rotate.


   

eumagga0x2a

Quote from: eumagga0x2a on May 18, 2021, 01:48:04 PMDoes it mean that WMP ignores rotation metadata set by the MP4 muxer in Avidemux?

Got to test this myself: everything is fine, Windows Media Player on Windows 10 correctly obeys the rotation flag set by Avidemux.

guyr

Quote from: butterw on May 18, 2021, 10:17:12 AM- mp4 container metadata rotate flags doesn't require re-encode, but may or may not be supported by applications (ex: Avidemux doesn't apply it).

Thank you for the explanation, I understand the difference now.  I should have mentioned I'm using Windows 7 Pro.  That probably explains the differences we are seeing when playing back through WMP.  BTW, I also experienced that Avidemux doesn't honor the rotate value set by MP4Muxer.  Avidemux states explicitly that it displays the raw video, but it's a little confusing to new users.

I only need to rotate videos probably twice a year, so now that I understand how it works, the current implementation is fine for my limited use.  Thanks much.

eumagga0x2a

Quote from: guyr on May 19, 2021, 02:02:06 AMBTW, I also experienced that Avidemux doesn't honor the rotate value set by MP4Muxer.

Yes, this is by design. However, support for rotation flag, at least at the level of detection, can be added in the future.

User007

#9
Quote from: eumagga0x2a on February 24, 2021, 06:58:21 AMYou need to specify the needed rotation in the configuration of the MP4 muxer.
This setting only affects video rotation when you save it without encoding, is there way to turn it 90 degree in preview on main window?

Even if enable re-encoding and use rotation filter still in main window video shows sideways.