1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[ffmpeg]Pythonのsubprocessを使ってffmpegしたらThe system cannot find the path specified.

Posted at

環境

windows 10
python 3.7
ffmpeg 不明

やろうとしたこと

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

動画ファイルのクロップをするコマンドを実行しようとしています。
しかし、エラーメッセージが...

The system cannot find the path specified.

しかし、ファイルもちゃんと存在しているし、print(command)してそれをコマンドプロンプトで実行すると成功する。

結論

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

で直りました

これに2時間ほどハマっていたので...

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?