简体   繁体   English

将音频添加到ffmpeg视频流

[英]add audio to ffmpeg video stream

I have a ffmpeg command that takes a stream of frames and pipes out a ogg video. 我有一个ffmpeg命令,它可以接收帧流并输出ogg视频。 How can I add audio to this from another file? 如何从另一个文件为此添加音频?

ffmpeg -f rawvideo -pix_fmt bgr24 -s WIDTHxHEIGHT -r 30 -i - -f ogg -an -qscale:v 10 pipe:1

You can add another -i parameter to add another input source. 您可以添加另一个-i参数来添加另一个输入源。

However, your -an parameter disables audio entirely, so you'll need to remove that. 但是,您的-an参数会完全禁用音频,因此您需要将其删除。

This worked for me when I tested it: 当我测试它对我有用:

ffmpeg -f rawvideo -pix_fmt bgr24 -s WIDTHxHEIGHT -r 30 -i - -i audio.mp3 -f ogg -qscale:v 10 pipe:1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM