0

我做了这个脚本

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

任何人都可以帮助我 任何人都可以帮助我 任何人都可以帮助我

4

0 回答 0