I am fairly new to python, this is my first real project and I have come to a roadblock. What I have here is a .wmv file, I am using FFprobe to extract the duration in seconds from the .wmv file. When I run the following command in the CMD:
ffprobe -i Video2.wmv -show_entries format=duration -v quiet -of csv="p=0"
I get successful output.
However, when I use os.system, like this:
os.system('ffprobe -i Video2.wmv -show_entries format=duration -v quiet -of csv="p=0"')
I get the following output:
'ffprobe' is not recognized as an internal or external command, operable program or batch file.
This is very confusing and I haven't been able to find a fix to this exact problem online, any input would be very much appreciated.
Python can't find ffprobe because it isn't in your environment variables. This youtube video shows how to properly install it, as does this wikihow page (method 2), which I'll quote from here:
I hope that helps.
Just a side note, I don't think that
os.system
is the recommended way of calling the command line like that any more.I'd recommend something more like this using subprocess instead (adapted from code here):