Giter Club home page Giter Club logo

qtrotate's Introduction

Quicktime/MP4 Rotation Tools

Tools to work with rotated Quicktime/MP4 files. Currently this consists of a tool to detect and return the rotation angle if one can be found. Once known, you can use the info to rotate the video using MEncoder's rotate filter, AviSynth, etc. You can also write a new rotation angle into the files.

NOTE that translation info will be LOST if a new rotation angle is written.

Patches and new tools welcome.

Simple Usage

The script is usable as both a Python library and a standalone script:

$ ./qtrotate.py myfile.mp4
90

$ ./qtrotate.py myfile2.mp4 -90
$ ./qtrotate.py myfile2.mp4
270

License

Copyright (c) 2008 - 2009 Daniel G. Taylor [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

qtrotate's People

Contributors

danielgtaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtrotate's Issues

Script still works after 10 years! Add exiftool matrix info for geeky output?

Hello and a huge thanks for your script. I've been searching many times the net for a solution and somewhat did not stumble all these years, but tonight. Thank you, thank you, thank you. I had found a very nice and clean solution with ffmpeg (keeping most of the iOS metadata but MOV to MP4) but your script is a gem; those 4 bytes changed, made all the difference (binary-compared original MOV and rotated MOV files).

Your 10-year old script works on a Mac running High Sierra 10.13.5 and iOS 12.3.1 movies (H.264). I just really wanted to express my sincere thanks.

Would it be too geeky to add exiftool's (if it exists on the system) composition matrix structure just for showing what changed? Before and after conversion?

exiftool to-fix.mov -rotation -matrixstructure -G0:1 -a
[Composite:Main] Rotation                      : 90
[QuickTime] Matrix Structure                   : 1 0 0 0 1 0 0 0 1
[QuickTime:Track1] Matrix Structure            : 0 1 0 -1 0 0 1080 0 1
[QuickTime:Track2] Matrix Structure            : 1 0 0 0 1 0 0 0 1
[QuickTime:Track3] Matrix Structure            : 1 0 0 0 1 0 0 0 1
[QuickTime:Track4] Matrix Structure            : 1 0 0 0 1 0 0 0 1

exiftool fixed.mov -rotation -matrixstructure -G0:1 -a
[Composite:Main] Rotation                      : 0
[QuickTime] Matrix Structure                   : 1 0 0 0 1 0 0 0 1
[QuickTime:Track1] Matrix Structure            : 1 0 0 0 1 0 0 0 1
[QuickTime:Track2] Matrix Structure            : 1 0 0 0 1 0 0 0 1
[QuickTime:Track3] Matrix Structure            : 1 0 0 0 1 0 0 0 1
[QuickTime:Track4] Matrix Structure            : 1 0 0 0 1 0 0 0 1

In any case, thanks, this is a mere suggestion ;-)

The idea came from this thread post.

Huge thanks again!

Videos recorded on iOS 11

I am facing a strange issue on my app . When I try to get_set_rotation for a video recorded on iOS 11 , I am getting

" moov atom not found, is this a valid MOV/MP4 file? "

qtfaststart can see moov atom present in the file ?

What could be the issue ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.