fourMs / MGT-python

Musical Gestures Toolbox for Python
https://www.uio.no/ritmo/english/research/labs/fourms/downloads/software/musicalgesturestoolbox/mgt-python/index.html
GNU General Public License v3.0
52 stars 11 forks source link

Motion() chokes on rotated video files #289

Closed alexarje closed 1 year ago

alexarje commented 1 year ago

I just discovered that motion() doesn't like video files that have been rotated in metadata (description here). Would be good to check for this somehow.

joachimpoutaraud commented 1 year ago

This was due to the fact that when rotating a video with ffmpeg by only modifying the metadata in the file, the height and the width used for the motion() function were not updated. I have updated the get_widthheight() function so that it first checks if the video has been rotated by 90 degrees, and if yes it inverts the values corresponding to width and height.