Comment 12 for bug 697756

Revision history for this message
Michael Doube (michael-doube) wrote :

Still reproducible in 12.04.

It seems that the QuickTime file format uses a 3x3 transformation matrix to encode a mapping from 'camera space' to 'display space'. In the case of simple 90° and 180° rotations that matrix is all zeros and (minus) ones. So, this should just be a case of getting the bytes of the transformation matrix and working out which way to do the rotation.

https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-56313

https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-18737

An algorithm might go like:
parse bytes looking for 'mvhd'
skip ahead 36 bytes
read the next 36 bytes into a 3x3 matrix (4 bytes per element)
calculate the rotation
do the rotation during playback