I am relatively new to python, I am working on extracting some metadata from a video and I am trying to use ffmpeg.probe (or ffprobe) because it provides all the data I need.
After many errors I went to the basic and tried:
import ffmpeg
import json
movie_path="E:\Archive\Peliculas\Clasicos\Casablanca.avi"
probe = ffmpeg.probe(movie_path)
The error that I get is:
Traceback (most recent call last):
File "C:\Users\xxx\Desktop\test.py", line 5, in <module>
probe = ffmpeg.probe(movie_path)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\ffmpeg\_probe.py", line 20, in probe
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
I have been searching around and tried installing and uninstalling ffmpeg, ffmpeg-python, installing it directly on windows (adding the files to the path so that I can run it in the console). Then tried to do it on my own using the _probe.py as example:
p = subprocess.Popen(['ffprobe', '-show_format', '-show_streams', '-of', 'json', 'E:\Archive\Peliculas\Clasicos\Casablanca.avi'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) #shell=True is not present in _probe.py but it wont run otherwise
out, err = p.communicate()
The error returned is: b'"ffprobe" is not recognized as an internal or external command, \r\n program, or executable batch file.\r\n'
but runs, it is not the "FileNotFoundError"
When I run it in cmd there is no issue, ffprobe -show_format -show_streams -of json E:\Archive\Peliculas\Clasicos\Casablanca.avi provides the information (with a couple of lines before the JSON but works).
I don't know if it is a windows thing (I have tried both \ and \\ already with no apparent difference) or I am doing wrong.