Python FFmpeg 不接受路径

问题描述

我制作了这个脚本

import os
import sys
import subprocess
from tkinter import *
from tkinter import filedialog
print("Compressing......")
file_path = filedialog.askopenfilename(title = "Select Video",filetypes = (("Mp4","*.mp4"),("AVI","*.avi"),("MOV","*.mov"),("3gp","*.3gp")))
print (file_path)
result = subprocess.run("TOOLS\\ffmpeg.exe -i "+ (str(file_path))+"-b 800k output.mp4")
print("Process Succesfull")

但是当我运行它并选择一个文件时,这个错误即将到来-

Traceback (most recent call last):
  File "D:\Compressor.py",line 10,in <module>
    result = subprocess.run("TOOLS\\ffmpeg.exe -i "+ (str(file_path))+"-b 800k output.mp4")
  File "C:\Program Files\Python37\lib\subprocess.py",line 488,in run
    with Popen(*popenargs,**kwargs) as process:
  File "C:\Program Files\Python37\lib\subprocess.py",line 800,in __init__
    restore_signals,start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py",line 1207,in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

谁能帮帮我 有谁能够帮我 谁能帮帮我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)