Opened 5 years ago

Closed 11 months ago

Last modified 11 days ago

#2202 closed Feature Request (fixed)

implement support MP4/FLV rotation flag used by iPhone/Android Camera app

Reported by: mpioner Owned by: underground78
Priority: normal Milestone: 1.7.11
Component: General Version: 1.6.5.6366
Severity: normal Keywords: rotate rotation orientation
Cc: acDCuk, Kapela, peterj Evaluation:

Description

implement support MP4/FLV rotation flag used by iPhone Camera app

Attachments (1)

IMG_0036.MOV (1.5 MB) - added by JellyFrog 4 years ago.

Download all attachments as: .zip

Change History (43)

comment:1 follow-up: Changed 5 years ago by underground78

Upload a sample, that will probably help implementing this feature.

comment:2 Changed 5 years ago by thevbm

Yes, this would be useful. Not just iPhone but all apple gadgets use this if i'm not mistaken.

+1

comment:3 in reply to: ↑ 1 Changed 5 years ago by mpioner

comment:4 Changed 5 years ago by underground78

  • Cc aleksoid v0lt added

comment:5 Changed 4 years ago by JellyFrog

  • Cc underground78 added; aleksoid v0lt removed
  • Keywords rotation orientation added
  • Severity changed from major to normal
  • Version changed from 1.6.1.4235 to 1.6.5.6366

Changed 4 years ago by JellyFrog

comment:6 Changed 4 years ago by JellyFrog

Sample dead, I attached a new one

comment:7 follow-up: Changed 3 years ago by kasper93

Refs #4448

comment:8 in reply to: ↑ 7 Changed 3 years ago by acDCuk

Replying to kasper93:

Refs #4448

My apologies for the duplicate report.

The attached video by JellyFrog IMG_0036.MOV shows the same symptoms I reported on #4448 exactly, and I consider it to be a bug, not a feature request. Could this ticket be changed to Bug?

The attached video by JellyFrog the video playback orientation is upsidedown! The MediaInfo in the attached .MOV shows the field "Rotation: 180°" right under the Aspect Ratio, therefore all MPC-HC needs to be told to do, is to auto rotate clock-wise by that number of degrees.


Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Rotation : 180°
Frame rate mode : Constant
Frame rate : 24.000 fps
Color space : YUV


In videos rotated 90°, simply rotating is not enough, When using Alt + Num pad keys to rotate, it is also nessecary to Zoom out of a 90° rotated video too

comment:9 Changed 3 years ago by underground78

  • Cc acDCuk nevcairiel added
  • Milestone next release placeholder deleted

It's quite not that simple to handle. I would say it's an open question how to deal with that correct in a DirectShow chain.

@nevcairiel: Any idea how this could be worked out?

comment:10 Changed 2 years ago by underground78

  • Cc Kapela added

Ref: #4925.

comment:11 Changed 2 years ago by peterj

Hi All, joining this discussion since #4409 was closed. This issues affects video recorded on Android cellphones as well, not only iPhones.

From a user perspective it's a bug since other Windows applications such as Google Chrome, MPEG Streamclip, etc can play the videos in correct rotation.

I understand that from a dev perspective it's a feature request since, but please put it on the to-do list since it's affecting quite a few of us.

comment:12 Changed 2 years ago by peterj

@underground78: btw please add me on cc to this item, I'm keen to see it resolved and happy to beta test any new builds

comment:13 Changed 2 years ago by underground78

  • Cc peterj added

comment:14 Changed 2 years ago by cwalger

+1 The decrpition should be changed to:
implement support MP4/FLV rotation flag used by iPhone and Android Camera apps.

comment:15 Changed 2 years ago by underground78

  • Summary changed from implement support MP4/FLV rotation flag used by iPhone Camera app to implement support MP4/FLV rotation flag used by iPhone/Android Camera app

comment:16 Changed 2 years ago by macacinsaituvostru

+1

comment:17 Changed 16 months ago by peterj

Hi Devs, does the version above need to be changed from 1.6.5 to "all versions"? Problem is still there even with latest build 1.7.10

comment:18 Changed 15 months ago by peterj

Hi Devs, Mods, other users, I just installed madVR and the rotation problem was immediately and transparently solved :-) I didn't need to make any adjustments to any default settings, simply selected madVR as the renderer, quit and restart MPC-HC to activate the renderer, then played a video recorded on my smartphone and it displayed with correct rotation.

Conclusion is that this FR is for the default MPC-HC renderer, not for MPC-HC itself. By installing and selecting a renderer that correctly supports rotation, such as madVR, problem is solved.

I think you can close this thread, or reassign it to whoever develops the default renderer (EVR?).

comment:19 Changed 15 months ago by underground78

  • Cc madshi added

@madshi: How is this handled by madVR? Custom interface with LAV Filters?

comment:20 Changed 15 months ago by madshi

LAV reports this information somehow and madVR simply reads it. I don't recall the exact interface name right now, but if you search the LAV source code for either "ROTATE" or "ROTATION" it should be easy to find.

comment:21 Changed 15 months ago by underground78

  • Cc nevcairiel madshi removed

Damn, I never noticed LAV was actually reporting this. Thanks for the information, I will have a look.

comment:22 Changed 15 months ago by nevcairiel

0.60.0 - 2014/01/12
LAV Splitter
- Additional metadata from the source file is exported through IPropertyBag (including "ROTATION" for video orientation information)

:D

comment:23 Changed 15 months ago by madshi

That is nevcairiel thinking ahead of his time... :)

Last edited 15 months ago by madshi (previous) (diff)

comment:24 Changed 15 months ago by underground78

Not sure how I missed this... This ticket is 4 years old and I was still convinced that I was waiting for something on LAV side.

comment:25 Changed 15 months ago by madshi

There are also APIs available for madVR to control rotation from within MPC-HC, if you want to do that. But it shouldn't be necessary for madVR. Rotation should be performed correctly automatically. And the user can rotate manually by assigning keyboard shortcuts. Ctrl+Alt+Shift+Left/Right being set by default, IIRC. But in case you have rotation keyboards setup yourself, or add menu items or stuff, just check "mvrInterfaces.h" for rotation APIs.

comment:26 Changed 15 months ago by underground78

I don't think there are any issue with madVR, it's mostly for our renderers.

comment:28 in reply to: ↑ 27 Changed 15 months ago by Kapela

Replying to clsid2:

https://github.com/mpc-hc/mpc-hc/commit/67944d8b45d5d74c3d18d4eb6062eff03358035d

Will this also support built-in LAV Splitter & Decoder?

Last edited 15 months ago by Kapela (previous) (diff)

comment:29 Changed 15 months ago by underground78

This commit is just to support manual rotation with madVR. Automatic rotation was already working with madVR before that and manual rotation is already working for the internal renderers. So what's missing is the automatic rotation for the internal renderers.

comment:30 Changed 13 months ago by underground78

  • Cc underground78 removed
  • Owner set to underground78
  • Status changed from new to accepted

comment:31 Changed 12 months ago by Underground78 <underground78@…

  • Resolution set to fixed
  • Status changed from accepted to closed

In 2ff1b3:

Automatically rotate MP4/MOV/FLV files when the rotation info is available.

This is mostly useful for files recorded with mobile phones.

Fixes #2202.

comment:32 follow-up: Changed 12 months ago by underground78

  • Milestone set to next release

Will be in the nightly builds as of version 1.7.10.146.

comment:33 in reply to: ↑ 32 Changed 12 months ago by acDCuk

Replying to underground78:

Will be in the nightly builds as of version 1.7.10.146.

i just tested it in latest nightly build and it is not fixed... although there is a change in orientation now being recognised, it is in the wrong direction. it should be rotated by the degrees specified in the mediainfo clockwise, instead it is rotating the same degrees but in counter-clockwise direction. this is resulting in my videos recorded on my phone (while held in portrait) to be played back upside down instead of the correct orientation.

comment:34 Changed 12 months ago by underground78

Hmm, could you upload a test file somewhere? The file I used to test my change showed no problem, either it was a 180° rotation or I didn't notice the orientation was wrong...

comment:35 Changed 12 months ago by underground78

  • Resolution fixed deleted
  • Status changed from closed to reopened

Ok, I was able to reproduce the issue.

Unfortunately there is another problem that I had completely forgotten... The window size won't take into account the rotation so the video will be truncated. :/ I will be on holidays for a few days, I will fix that while I'm away so it should be ready by the end of next week.

comment:36 Changed 12 months ago by Aleksoid1978

Confirm - incorrect video size when rotate by 90.

comment:37 Changed 11 months ago by Underground78 <underground78@…

  • Resolution set to fixed
  • Status changed from reopened to closed

In bc6ba6:

Fix: Automatic rotation should rotate the whole window.

After 2ff1b3776d0915dd03ef32e866696212fadd26c6, videos with 90° or 270° rotations were not displayed entirely because the window was not rotated.

Note that default rotation is rounded to the nearest 90° multiple for the sake of simplicity but it should never be a problem.

Fixes #2202.

comment:38 follow-up: Changed 11 months ago by underground78

Should be fixed for good in the nightly builds as of version 1.7.10.184.

comment:39 in reply to: ↑ 38 Changed 11 months ago by acDCuk

Replying to underground78:

Should be fixed for good in the nightly builds as of version 1.7.10.184.


i can confirm this is now working as desired :) thank you for your efforts

comment:40 Changed 11 months ago by cwalger

Yes, +1 fixed! Thank you so much!

comment:41 Changed 3 weeks ago by thevbm

  • Milestone changed from next release to 1.7.11

Milestone renamed

comment:42 Changed 11 days ago by her34

Can a menu item be added to manually change rotation?

Menu bar > view > Pan&Scan menu

This is important issue because people start recording video and then turn phone. The video metadata will have starting orientation.

Note: See TracTickets for help on using tickets.