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

Thumbnail rotation issue #51

Open
inabhi9 opened this issue Dec 29, 2014 · 0 comments
Open

Thumbnail rotation issue #51

inabhi9 opened this issue Dec 29, 2014 · 0 comments

Comments

@inabhi9
Copy link

inabhi9 commented Dec 29, 2014

When video is recorded from iPhone, it has some metadata information of orientation. While creating the thumbnail from ffmpeg it doesn't take that into the consideration and creates thumbnail of different orientation.

It would be great if you read that orientation in thumbnail() and pass the rotating argument to ffmpeg accordingly

May be this snippet should work under thumbnails()

        probe = self.probe(fname)
        rotation = 0
        for stream in probe.streams:
            if stream.type == 'video' and stream.metadata.get('rotate'):
                rotation = int(stream.metadata.get('rotate'))
                break
        if rotation == 180:
            cmds.extend(["-vf", "vflip,hflip"])
        elif rotation == 90:
            cmds.extend(["-vf", "transpose=1"])
        elif rotation == 270 or rotation == -90:
            cmds.extend(["-vf", "transpose=2"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant