MP4 Video wrong orientation if made in portrait
Moderators: Hacker, petermad, Stefan2, white
MP4 Video wrong orientation if made in portrait
I have many mp4 videos made in portrait mode.
Most of it are displayed by TC with the wrong rotated orientation.
This is regradless of using the LAV filters installed in TC
or the the System default filters which are K-Lite_Codec_Pack_1620_Basic.
Windows media player, VLC and Explorer preview in TC are all playing in correct orientation.
Most of it are displayed by TC with the wrong rotated orientation.
This is regradless of using the LAV filters installed in TC
or the the System default filters which are K-Lite_Codec_Pack_1620_Basic.
Windows media player, VLC and Explorer preview in TC are all playing in correct orientation.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: MP4 Video wrong orientation if made in portrait
I can confirm that for videos recorded with my 3 different Smart Phones in portrait mode.
I have different results in Windows 7 and Windows 10 for the same programs:
Windows 7:
Windows Media Player, MMedia TC plugin, Explorer Preview, IrfanView and XnView shows Landscape.
XnView MP shows upside-down Portrait
MPC Player, DivX Player and Quicktime Player shows Portrait.
Windows 10:
Windows Media Player, MPC Player, Quicktime Player, MMedia TC plugin and IrfanView shows Portrait
Explorer Preview only shows a Still picture
XnView shows Landscape
Windows Photos App and Windows Movies & TV App shows Portrait
I have different results in Windows 7 and Windows 10 for the same programs:
Windows 7:
Windows Media Player, MMedia TC plugin, Explorer Preview, IrfanView and XnView shows Landscape.
XnView MP shows upside-down Portrait
MPC Player, DivX Player and Quicktime Player shows Portrait.
Windows 10:
Windows Media Player, MPC Player, Quicktime Player, MMedia TC plugin and IrfanView shows Portrait
Explorer Preview only shows a Still picture
XnView shows Landscape
Windows Photos App and Windows Movies & TV App shows Portrait
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: MP4 Video wrong orientation if made in portrait
I do not have any videos which play with wrong orientation. Could you send me a link to such a video by e-mail? Or a small video to cghisler at gmail dot com?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: MP4 Video wrong orientation if made in portrait
Mail sendghisler(Author) wrote: 2021-05-23, 08:38 UTC I do not have any videos which play with wrong orientation. Could you send me a link to such a video by e-mail? Or a small video to cghisler at gmail dot com?
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: MP4 Video wrong orientation if made in portrait
2ghisler(Author)
You can also try this: https://madsenworld.dk/tcmd/portraitmovie.mp4
In contrast to this: https://madsenworld.dk/tcmd/landscapemovie.mp4
You can also try this: https://madsenworld.dk/tcmd/portraitmovie.mp4
In contrast to this: https://madsenworld.dk/tcmd/landscapemovie.mp4
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: MP4 Video wrong orientation if made in portrait
Thanks for the videos.
portraitmovie.mp4 is played in portrait mode here by VLC (correct), but in landscape mode by Windows Media Player Classic with the LAV Video codecs (incorrect).
graphstudionext.exe also plays it in landscape mode (incorrect).
Maybe I need to add a filter to rotate the image? Any ideas?
portraitmovie.mp4 is played in portrait mode here by VLC (correct), but in landscape mode by Windows Media Player Classic with the LAV Video codecs (incorrect).
graphstudionext.exe also plays it in landscape mode (incorrect).
Maybe I need to add a filter to rotate the image? Any ideas?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: MP4 Video wrong orientation if made in portrait
2ghisler(Author)
What Media Player Classic do you mean?
For me both MPC-HC and MPC-BC play in portrait mode while VLC (3.0.14) and Windows Media Player 11 play in landscape mode. I can't find needed option in VLC.
What Media Player Classic do you mean?
For me both MPC-HC and MPC-BC play in portrait mode while VLC (3.0.14) and Windows Media Player 11 play in landscape mode. I can't find needed option in VLC.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: MP4 Video wrong orientation if made in portrait
VLC without any special option plays correct in portrait.Usher wrote: 2021-05-23, 19:55 UTC 2ghisler(Author)
What Media Player Classic do you mean?
For me both MPC-HC and MPC-BC play in portrait mode while VLC (3.0.14) and Windows Media Player 11 play in landscape mode. I can't find needed option in VLC.
Also Windows Media and Explorer preview play in portrait with K-Lite Codecs.
Only problem is TC which plays wrong regardless of Codecs (LAV or K-Lite)
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: MP4 Video wrong orientation if made in portrait
The pixels in the video are actually stored in landscape mode, there is just an indication in the header that the video needs to be rotated. So apparently some filters do this decoding, others don't.
Can you see in graphstudionext or graphedit whether they add an extra filter? Or check the filter chain in the right click menu of Media Player Classic for any rotation filters?
According to Stackoverflow replies, DirectShow does NOT support the rotation of videos by itself, see e.g.:
https://stackoverflow.com/questions/30194580/direct-show-camera-rotation-90-degree
So it either needs to be supported by the video decoder filter, or another filter needs to be added which does the rotation. I found a project which claims to do it, but it crashes when adding the filter. There is also a commercial project I haven't tried yet.
Edit: I found someething interesting: LAV filters do not rotate the video, but they pass the information to the video renderer which would then have to rotate it:
https://forum.doom9.org/showthread.php?p=1758791
Apparently only the MadVR renderer supports rotation, but I cannot use it because MadVR does not support windowless output. I'm using the Windows "Enhanved Video Renderer", which supports windowless output (sent to my own window), but does not support video rotation.
I have to use windowless output because my player is entirely working in a background thread, so it cannot freeze Lister. Windowed output as used by MadVR outputs to its own window control. If I set that window as a child of Lister, then a hanging player would also hang Lister and Total Commander.
Can you see in graphstudionext or graphedit whether they add an extra filter? Or check the filter chain in the right click menu of Media Player Classic for any rotation filters?
According to Stackoverflow replies, DirectShow does NOT support the rotation of videos by itself, see e.g.:
https://stackoverflow.com/questions/30194580/direct-show-camera-rotation-90-degree
So it either needs to be supported by the video decoder filter, or another filter needs to be added which does the rotation. I found a project which claims to do it, but it crashes when adding the filter. There is also a commercial project I haven't tried yet.
I'm using "Media Player Classic - Home Cinema" from http://www.cccp-project.net/ which is unfortunately no longer maintained.What Media Player Classic do you mean?
Edit: I found someething interesting: LAV filters do not rotate the video, but they pass the information to the video renderer which would then have to rotate it:
https://forum.doom9.org/showthread.php?p=1758791
Apparently only the MadVR renderer supports rotation, but I cannot use it because MadVR does not support windowless output. I'm using the Windows "Enhanved Video Renderer", which supports windowless output (sent to my own window), but does not support video rotation.
I have to use windowless output because my player is entirely working in a background thread, so it cannot freeze Lister. Windowed output as used by MadVR outputs to its own window control. If I set that window as a child of Lister, then a hanging player would also hang Lister and Total Commander.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: MP4 Video wrong orientation if made in portrait
2ghisler(Author)
Here is what I se in graphstudionext: https://madsenworld.dk/tcmd/graphstudionext.png - and graphstudionext does NOT rotate the video - with the 32bit version I have not registered the LAV filters.
Here is what I se in graphstudionext64: https://madsenworld.dk/tcmd/graphstudionext64.png - graphstudionext64 does NOT rotate the video correctly (Windows 7) - All 3 LAV filters are registered system wide (otherwise I get an error from graphstudionext64.exe)Can you see in graphstudionext or graphedit whether they add an extra filter? Or check the filter chain in the right click menu of Media Player Classic for any rotation filters?
Here is what I se in graphstudionext: https://madsenworld.dk/tcmd/graphstudionext.png - and graphstudionext does NOT rotate the video - with the 32bit version I have not registered the LAV filters.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: MP4 Video wrong orientation if made in portrait
That's not what I meant - I meant using File - Connect to remote graph when a video player with correctly rotated video is playing. This will NOT work with VLC because VLC isn't using DirectShow.
Btw, here it works correctly with MPC-HC when I change the output filter to the MadVR renderer - the one I can't use.
I will probably have to write my own rotation filter...
Btw, here it works correctly with MPC-HC when I change the output filter to the MadVR renderer - the one I can't use.
I will probably have to write my own rotation filter...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: MP4 Video wrong orientation if made in portrait
Your MPC-HC version is very outdated. MPC-HC was developed on mpc-hc.org and is still maintained on Github by one of the developers.ghisler(Author) wrote: 2021-05-24, 08:27 UTCI'm using "Media Player Classic - Home Cinema" from http://www.cccp-project.net/ which is unfortunately no longer maintained.What Media Player Classic do you mean?
I've been already posted the proper link https://github.com/clsid2/mpc-hc
See also older topic: viewtopic.php?f=15&t=74180&p=398768#p398768
Apparently I have to change video renderer in VLC. Thanks for the info.ghisler(Author) wrote: 2021-05-24, 08:27 UTC Edit: I found someething interesting: LAV filters do not rotate the video, but they pass the information to the video renderer which would then have to rotate it:
https://forum.doom9.org/showthread.php?p=1758791
Apparently only the MadVR renderer supports rotation, but I cannot use it because MadVR does not support windowless output.
EDIT. Changed video output in VLC from DirectX (DirectDraw) to Automatic and now it works OK.
Aparrently @Horst.Epp doesn't know this very special VLC option ;-P
Last edited by Usher on 2021-05-24, 18:31 UTC, edited 1 time in total.
Andrzej P. Wozniak
Polish subforum moderator
Polish subforum moderator
Re: MP4 Video wrong orientation if made in portrait
2ghisler(Author)
HMM, it playes in portrait in my Windows Media Player Classic v. 1.7.13portraitmovie.mp4 is played in portrait mode here by VLC (correct), but in landscape mode by Windows Media Player Classic with the LAV Video codecs (incorrect).
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: MP4 Video wrong orientation if made in portrait
As I wrote, it depends on the output filter used. MadVR and newer internal MPC-HC output filters seem to support it, the one I used (Windows Enhanced Video Renderer) doesn't. Writing my own video renderer filter is out of the question, it's very complex and requires handling of Direct3d and other complex things. Writing my own rotation filter is a possibility, I made some tests and it seems to be doable, but it's also time consuming.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: MP4 Video wrong orientation if made in portrait
Personaly I don't care much for this bug.ghisler(Author) wrote: 2021-05-25, 15:55 UTC As I wrote, it depends on the output filter used. MadVR and newer internal MPC-HC output filters seem to support it, the one I used (Windows Enhanced Video Renderer) doesn't. Writing my own video renderer filter is out of the question, it's very complex and requires handling of Direct3d and other complex things. Writing my own rotation filter is a possibility, I made some tests and it seems to be doable, but it's also time consuming.
I can just switch to Explorer preview for such videos.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64