python - 使用 ffmpeg 合并音频和视频 - Python Lib
问题描述
我努力了
import ffmpeg
video = ffmpeg.input('video.mp4')
audio = ffmpeg.input('audio.mp3')
ffmpeg.merge_outputs(video, audio).run()
它返回
TypeError: Expected incoming stream(s) to be of one of the following types: ffmpeg.nodes.OutputStream; got <class 'ffmpeg.nodes.FilterableStream'>
我试过了
import ffmpeg
video = ffmpeg.input('video.mp4')
audio = ffmpeg.input('audio.mp3')
ffmpeg.concat(video, audio, v=1, a=1).output('finished_video.mp4').run()
它返回
FileNotFoundError: [WinError 2] The system cannot find the file specified
我也试过
import subprocess
subprocess.run("ffmpeg -i video.mp4 -i audio.mp3 -c copy output.mp4")
它返回
'ffmpeg' is not recognized as an internal or external command
我怎样才能做对?
解决方案
推荐阅读
- android - 在这种情况下如何使用 JOIN 和 CASE WHEN 语句(sqlite android)
- java - 将应用程序置于后台时如何防止阴影中的通知图标消失
- javascript - TypeError:data.forEach 不是 javascript 中用于从 api 中获取数据的函数
- amazon-web-services - 在 Terraform 中如何处理错误?
- reactjs - 将道具值从一个类传递到另一个类
- aws-iot - AWS IoT - 事物组的影子更新
- windows - Net::XMPP Perl 模块:Windows 系统上的 ssl 路径错误
- python - 无法与 upwork 连接以获取任何信息
- laravel - Laravel - 电子邮件确认后停止自动登录
- c# - 如何在 Autofac 模块的依赖注入中注入 IHostedService