Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document rotation use case with ProjectionPoseRoll Element #269

Closed
hubblec4 opened this issue Sep 29, 2018 · 31 comments
Closed

document rotation use case with ProjectionPoseRoll Element #269

hubblec4 opened this issue Sep 29, 2018 · 31 comments
Labels
clarifications spec_main Main Matroska spec document target

Comments

@hubblec4
Copy link
Contributor

How complicated would it be to add new Matroska TagNames?
In my chatperEditor thread
is a user which uses this TagName to rotate the video while playback.

@dericed
Copy link
Contributor

dericed commented Oct 1, 2018

I'm unsure if a string tag is the best way to handle rotation. Perhaps we should consider other examples of handling this, such as the transformation matrix in QuickTime

@mbunkus
Copy link
Contributor

mbunkus commented Oct 1, 2018

Speaking from a practical point of view: is QT's transformation matrix used widely, and specifically, for anything other than rotation? I can see 90/180/270 degree rotation being useful due to people misusing their cameras/phones, but other than that transformations don't sound useful to me at all.

I agree that anything affecting the display/playback of content should not be done via tags but something else; if it's simple enough & static over the whole duration, the track headers.

@dericed
Copy link
Contributor

dericed commented Oct 1, 2018

Good point, but still this may be better handled with a dedicated unsigned integer elements than a string in a tag.

@hubblec4
Copy link
Contributor Author

hubblec4 commented Oct 1, 2018

To rotate a video via ROTATE tags is supported in three software players.

I'm unsure if a string tag is the best way to handle rotation.

For the moment is this the only way.

I agree that anything affecting the display/playback of content should not be done via tags but something else; if it's simple enough & static over the whole duration, the track headers.

OK, why not.

On the other hand it shows how "strong" Tags can be. Without to have a Matroska element for such case it is nevertheless possible to make it work.

Good point, but still this may be better handled with a dedicated unsigned integer elements than a string in a tag.

Yes, a new Matroska element named TrackRotation with an integer value could be added.

@dericed
Copy link
Contributor

dericed commented Oct 2, 2018

Actually, instead of considering a new Rotation Element, I think the existing ProjectionPoseRoll already handles this scenario.

Such as:

<Projection>
  <!-- '0' = 'rectangular' -->
  <ProjectionType>0</ProjectionType>
  <!-- unstored ProjectionPoseYaw and ProjectionPosePitch
       provide defaults of 0 rotation on right and up vectors -->
  <!-- ProjectionPoseRoll is a float in range of -180 to 180
       for rotation around the forward vector -->
  <ProjectionPoseRoll>$ROTATION</ProjectionPoseRoll>
</Projection>

If this is sufficient, I can close #271 and add some documentation to cover a basic rotation example.

@JeromeMartinez
Copy link
Contributor

Right, not surprising as the need is not new in video world and WebM needed it.
So IMO 271 need is already fulfilled, and we need to be more careful about not having duplicates.

@dericed dericed changed the title ROTATION: add new Matroska TagName document rotation use case with ProjectionPoseRoll Element Oct 2, 2018
@dericed
Copy link
Contributor

dericed commented Oct 2, 2018

I closed #271 without merge and updated the issue title. Does this approach work for you, @hubblec4?

@hubblec4
Copy link
Contributor Author

hubblec4 commented Oct 3, 2018

OK, an element for rotation exists, but:
There is already a software today with which you can set / change this element?
can a user change the value for this element(or delete the element) without remux the Matroska file?

I'm afraid no player today supports this element.

I guess players which supports rotation via Tags will don't remove this feature.

@JeromeMartinez
Copy link
Contributor

I guess players which supports rotation via Tags will don't remove this feature.

Having a standard method does not prevent tools to support pre-standard method, just that pre-standard method is not always what happens in the standard later.

and IIUC this is from WebM so Google, more tools (e.g. Google tools) will use the Google method instead of the pre-standard stuff.

@erdemguven
Copy link

erdemguven commented Oct 12, 2018

Hi, I'm working on ExoPlayer. We found out that a partner is using a custom track name format to encode rotation information. We want them to use a standard method and while searching for one we found this thread.

We discussed this solution with the authors of the Spherical Video V2. They said that these fields were not intended to be used for a rectangular video and they think it's odd to partially support the spec for just this use case.

Also it won't support other use cases like scaling, translation, skewing so they recommend using a transformation matrix like MP4 and others use.

@erdemguven
Copy link

So do you think it is worth reconsidering using #271 or a transformation matrix?

@dericed
Copy link
Contributor

dericed commented Oct 30, 2018

I suppose I'm not sure I agree with the authors of the Spherical Video V2 on this. It seems to me that the spherical elements as defined do handle the situation of rotation quite simply. Interested in finding more consensus on which direction to proceed in.

@erdemguven
Copy link

Adding @acolwell, one of the authors of the Spherical Video V2, in case he wants to add anything.

@andrewlewis
Copy link

@dericed @acolwell Currently ExoPlayer only supports some HTC-specific signaling for rotation in Matroska: google/ExoPlayer@42c3ff3. We'd like to support something more standardized, so what's the final decision on ProjectionPoseRoll vs. something else (e.g., a new element with a transform matrix like ISOBMFF)?

@dericed
Copy link
Contributor

dericed commented Nov 8, 2018

nudging @robUx4 & @mbunkus to gather consensus here.

IIUC the proposals here are:

  1. rotation is already supported via the ProjectionPoseRoll element (@dericed +1, @erdemguven -1)
  2. rotation should be supported via a metadata tag (@hubblec4)
  3. add a new rotation element (I drafted https://github.com/Matroska-Org/matroska-specification/pull/271/commits but prefer option 1)
  4. implementing an mp4 style transformation matrix

@hubblec4
Copy link
Contributor Author

hubblec4 commented Nov 8, 2018

For me is option 1 ok.

@robUx4
Copy link
Contributor

robUx4 commented Nov 9, 2018

Same for me ProjectionPoseRoll is the rotation on the Z axis (if you consider X,Y for a flat video). As the Pose name suggests it's what the user is suppose to see, not how the video was rotated before encoding.

This value is already supported for 360 videos in VLC it would be easy to support it for flat videos as well.

@robUx4 robUx4 added the spec_main Main Matroska spec document target label Dec 18, 2018
@robUx4
Copy link
Contributor

robUx4 commented Dec 18, 2018

Seems to be solved.

@robUx4 robUx4 closed this as completed Dec 18, 2018
@AlexFolland
Copy link

What commit solved it?

@robUx4
Copy link
Contributor

robUx4 commented Dec 18, 2018

Ah I thought we agreed on the way it's supposed to be done and that's using existing elements. But yes, more doc might be needed if it's not clear...

@robUx4 robUx4 reopened this Dec 18, 2018
@erdemguven
Copy link

Looks like the majority is in favor of option 1. To allow progress on this issue, I withdraw my objection. I think the issue can be closed.

We'll add support for rotations using ProjectionPoseRoll to ExoPlayer.

@hubblec4
Copy link
Contributor Author

Yes, we should close this issue.
First, the support of rotation is already there, and second my intention was to add an unofficial TagName to the official list.(@dericed has change the issue title and my intention was lost)

@erdemguven
Nice to read that you will add support for this official way of rotate a video. It is a step forward.
Is there maybe more interest to add more Matroska Features?
I'm looking for developers which have interest in Matroska Menu(native).

@erdemguven
Copy link

@hubblec4 I'm not aware of any plan for supporting any Matroska specific feature currently.

@dericed
Copy link
Contributor

dericed commented Dec 27, 2018

@erdemguven, I'd like to make sure that the language of the specification still addresses your underlying reservation in option 1. Is there any particular warning or recommendation about the use of this option that you'd like expressed within the document?

Also before closing the issue I'd suggest some documentation on this as using ProjectionPoseRoll for rotation isn't completely intuitive at first glace.

@hubblec4
Copy link
Contributor Author

hubblec4 commented Dec 28, 2018

Also before closing the issue I'd suggest some documentation on this as using ProjectionPoseRoll for rotation isn't completely intuitive at first glace.

Yes you are right @dericed.

@erdemguven

I'm not aware of any plan for supporting any Matroska specific feature currently.

Why not? Rotation is an extra feature and you will implement it. We have almost one million players which can play Matroska in a "boring normal way".
Where are the developers for better/best playback Matroska?

@erdemguven
Copy link

@dericed, perhaps it would be useful to add an example on how to use ProjectionPoseRoll with flat videos.

@hubblec4, you can make feature requests at https://github.com/google/ExoPlayer

@hubblec4
Copy link
Contributor Author

hubblec4 commented Jan 4, 2019

OK, I have open an issue for ExoPlayer.....

ojw28 pushed a commit to google/ExoPlayer that referenced this issue Jan 8, 2019
@JerryL1987
Copy link

May I know why use ProjectionPoseRoll but ProjectionPoseYaw to rotate video?
For samrtphone case, user will rotate Z-axis to record video. It should be Yaw rotation.
Anyone can answer me?

ojw28 pushed a commit to google/ExoPlayer that referenced this issue Jan 15, 2019
@hubblec4
Copy link
Contributor Author

The original thread was a question to add an unofficial TagName to the official TagName list.
This questions was answered within this thread: Answer is NO.
For me is this topic finished and we could close this issue.

How to use ProjectionPosRoll element is another question/issue.

@dericed
Copy link
Contributor

dericed commented Jun 26, 2019

IMHO, the ProjectionPosRoll element is already usable, but I think some documentation would be helpful to provide the rotation use case as an example.

dericed added a commit that referenced this issue Jul 12, 2019
@dericed
Copy link
Contributor

dericed commented Jul 22, 2019

closed via #326

@dericed dericed closed this as completed Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarifications spec_main Main Matroska spec document target
Projects
None yet
Development

No branches or pull requests

9 participants