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

[add] - add orientation info for movies based on ffmpeg hint #853

Merged
merged 1 commit into from Apr 8, 2012

Conversation

Memphiz
Copy link
Member

@Memphiz Memphiz commented Apr 5, 2012

This exposes any orientation info ffmpeg gives us now. Its based on the patch from this ticket:

http://trac.xbmc.org/ticket/12231

Credits go to acmay

The ffmpeg side is already fine now that we've bumped ffmpeg version.

For completly closing that ticket we need a way to rotate our video. I already discussed this with some other devs some month ago when this ticket was opened. Goal was a GPU based solution. Thats why i didn't merge that software rotation via ffmpeg filters which where part of the attached patch in that ticket, but only expose the orientation info for now.

So i have to ask the GL gurus now - how do wie rotate that damn thing :)

@Memphiz
Copy link
Member Author

Memphiz commented Apr 5, 2012

If someone wants to test this pr - here is the patch needed for applying videorotation by using ffmpeg filters:

http://pastebin.com/FcXzwWdH

The test movies are on the teamftp under my subdir.

@jmarshallnz
Copy link
Contributor

For a start you can get the extracted video thumbs done pretty easily. All you need is a map between whatever the orientation is giving you (rotation in degrees counter clockwise - might pay to doxy exactly what it is?) to EXIForientation-1 which is what we use in the texture stuff. Then instead of using swscale to dump out to the texture directly, hook it up instead to CPicture::CacheTexture() which will scale + rotate for you.

EXIF rotations you want are 5 and 7 for 90 degree rotations, and 2 for a 180 degree rotation IIRC. I presume there's no reflection involved?

For doing it on the CPU you could use the stuff in CGUITexture::OrientateTexture() - this assumes only 90/180 degree rotations or reflections and just modifies the texture coordinates accordingly. It's setup for reversing the rotation, so you might need to muck around a little bit.

For doing it on the GPU you need to throw another matrix on the stack for the vertex processing that does the same thing (eg for 90 degree rotations you invert one of x or y (to width-x or height-y) then swap them. For 180 you just invert both x and y.

@Memphiz
Copy link
Member Author

Memphiz commented Apr 5, 2012

Talking about thumbnails i don't see them on that test .mov files. The GPU thing was more a thought for the video rotation. I think rotating the thumbs on cpu wouldn't hurt.

@jmarshallnz
Copy link
Contributor

This commit partly moves towards this for the thumbs:

jmarshallnz@3ea3e99

Basically you'd then set the orientation param (first zero) appropriately and you'd be done.

@jmarshallnz
Copy link
Contributor

If you fix the comment about degrees (eg to "degrees counter clockwise" if that's what it does - you need to check ofcourse!) IMO this is fine to go in even before the GL side is done. @elupus you happy with that?

@Memphiz
Copy link
Member Author

Memphiz commented Apr 8, 2012

Fixed the comment (yep its counter clockwise - checked that one). If nobody complains i'll merge in 12 hours.

@elupus
Copy link
Contributor

elupus commented Apr 8, 2012

Fine by me.

Memphiz added a commit that referenced this pull request Apr 8, 2012
[add] - add orientation info for movies based on ffmpeg hint - part of #12231
@Memphiz Memphiz merged commit 67247b1 into xbmc:master Apr 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC PR submitted for gathering feedback Type: Feature non-breaking change which adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants