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

Mac ffmpeg issues #304

Closed finn42 closed 11 months ago

finn42 commented 11 months ago

The method of prompting a local ffmpeg installation does not seem to work on macs (OS 13.6). With an independent installation of ffmpeg, there are issues with calling video files to show via ffplay. Errors without mode='notebook' in video.show(): No such file or directory: ffplay fileloc.mp4 -window_title fileloc.mp4 -x 640 -y 480 Additionally, fails to read file locations without explicit paths, for example ../file.mp4

Fortunately, specifying path explicitly and using mode='notebook' seems to allow videos to be called and displayed. So far other functions are behaving as expected.

One potential source of conflict are structures of ffmpeg commands for OS running commands in ZSH instead of BASH.

joachimpoutaraud commented 11 months ago

Thank you for reporting this issue @finn42! On second thought, it might also simply be an error due to a bad string formatting in the toolbox. I have updated the _show.py script and replaced the wrap_str() function with more pythonic map() function for formatting the string properly when using ffplay.

I am not sure it can fix your issue but if you have time to test it on your pipeline with the updated version of the toolbox, it might be useful!

finn42 commented 11 months ago

After upgrading to 1.3.0, the local path worked for specifying a video file location like ../Data/IR/crop1.mp4. However video.show() continues to give that parsing error if I don't also specify mode=notebook. The error: FileNotFoundError: [Errno 2] No such file or directory: 'ffplay ../Data/IR/Overhead_testing/OverIR_C2_end.mp4 -window_title ../Data/IR/Overhead_testing/OverIR_C2_end.mp4 -x 640 -y 480'

joachimpoutaraud commented 11 months ago

Ok might be some internal conflit with ffplay which do not find the path of your video file, because the exact same path is used for loading and showing the video in the toolbox. Therefore, it should also crash when loading the video.

I have updated the mode='windowed' of the _show.py script by forcing ffplay to use the real path of the video file. Hopefully this should fix your issue!