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 problem when using non-MP4 file #271

Closed alexarje closed 1 year ago

alexarje commented 1 year ago

When running a script on a LRV file (a low-resolution GoPro Max file), I encountered problems with mg_motion:

/home/alexander/Downloads/Still Standing/2023-01-03/1-raw/GS010010_motion.LRV: No such file or directory Traceback (most recent call last): File "process.py", line 13, in <module> video.motion().average() File "/home/alexander/anaconda3/lib/python3.7/site-packages/musicalgestures/_motionvideo.py", line 289, in mg_motion embed_audio_in_video(source_audio, destination_video) File "/home/alexander/anaconda3/lib/python3.7/site-packages/musicalgestures/_utils.py", line 1346, in embed_audio_in_video os.remove(destination_video) FileNotFoundError: [Errno 2] No such file or directory: '/home/alexander/Downloads/Still Standing/2023-01-03/1-raw/GS010010_motion.LRV'

Looks like the problem is that it assumes an MP4 file as input, so it chokes when working with the LRV file. Everything else works fine, it runs the analysis and outputs all the files as expected. So the only problem is that it doesn't know that it should save the motion as something else than LRV.

joachimpoutaraud commented 1 year ago

Thank you for reporting this issue!

I have updated the MgVideo init file with an if statement specific for non-mp4 and avi files extensions (e.g. .lrv and .thm) in order to convert them to .mp4 before applying any processing.

The update is only available in the local repository at the moment, I will push a new version when I have done more work for the toolbox.