[ffmpeg] After ffmpeg using Python subprocess, The system cannot find the path specified.

environment

windows 10 python 3.7 ffmpeg unknown

What I tried to do

command = f'ffmpeg -i "{file_path}" -vf crop={Xl}:{Yl}:{Xs}:{Ys} "{out_path}"'
subprocess.call([command], shell=True)

I'm trying to execute a command to crop a video file. But the error message is ...

The system cannot find the path specified.

However, the file still exists, and when I print (command) and run it at the command prompt, it succeeds.

Conclusion

command = f'ffmpeg -i "{file_path}" -vf crop={Xl}:{Yl}:{Xs}:{Ys} "{out_path}"'
subprocess.call(command, shell=True)

It was fixed

I was addicted to this for about 2 hours, so ...

Recommended Posts

[ffmpeg] After ffmpeg using Python subprocess, The system cannot find the path specified.
Find the geometric mean of n! Using Python
[Introduction to Algorithm] Find the shortest path [Python3]
Find the shortest path with the Python Dijkstra's algorithm
Find the maximum Python
Find the maximum python (improved)
Find the critical path of PERT using breadth-first search and depth-first search
Get the desktop path in Python
Get the script path in Python
Find the Levenshtein Distance with python
Extract the targz file using python
Get the desktop path in Python
Try using the Python Cmd module
Get the file path using Pathlib