python-video-converter icon indicating copy to clipboard operation
python-video-converter copied to clipboard

Thumbnail rotation issue

Open inabhi9 opened this issue 10 years ago • 0 comments

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"])

inabhi9 avatar Dec 29 '14 15:12 inabhi9