使用 ffmpeg 将 video.ts 文件转换为 video.mp4

Convert video.ts file into video.mp4 using ffmpeg

所以我尝试将名为 video.ts 的文件转换为 Python 中的 video.mp4,但出现错误:

FileNotFoundError: [WinError 2] The system cannot find the file specified

假设 video.ts 已经加载到已经导入的程序和子进程中。

这是由于行:

>>> subprocess.run(['ffmpeg', '-i', 'video.ts', 'video.mp4'])但是不知道是什么问题

我打开了 video.ts 文件,它似乎工作正常。 Python 版本 (3.8.2)

对于遇到此问题的任何人,请下载 ffmpeg(通常在 zip 中),解压缩,进入 bin 目录,然后复制路径(例如 [=20 的位置=]).然后在开始菜单中输入环境变量,将此路径添加到名为PATH的变量中并保存。完成!

如果仍有问题,请重新启动您的程序,或者进一步重新启动您的设备