简体   繁体   English

ffmpeg:将两个单声道现场音频流组合为单个立体声流

[英]ffmpeg: combine two mono live audio stream to single stereo stream

I have two live audio streams, they both are MONO streams. 我有两个实时音频流,它们都是MONO流。 Now I want these two streams to merge in one stream and output to single new stream. 现在,我希望这两个流合并为一个流,并输出到单个新流。

I am merging two input streams with following command: 我使用以下命令合并两个输入流:

ffmpeg -i rtmp://myIp:1935/live/stream1 -i rtmp://myIp:1935/live/stream2 -codec:a aac -strict -2 -filter_complex "[0:a][1:a]amerge" -f flv rtmp://myIp:1935/live/myStream

The above command works but when I listen to new stream ie myStream , both streams are able to listen but in separate channel . 上面的命令有效,但是当我收听新的流(即myStream ,两个流都可以侦听,但要在单独的通道中进行 Means stream1 is only in Left channel and stream2 is only in Right channel . 表示stream1仅在Left通道中stream2仅在Right通道中

What I want is, both input stream stream1 and stream2 should be available to both the channels (Left & Right). 我想要的是,输入流stream1和stream2都应该对两个通道都可用(左和右)。

I have tried lot but can't get success and I am not good at ffmpeg also. 我已经尝试了很多,但没有成功,我也不擅长ffmpeg So Is there anyone who can help me in this ??? 那么有没有人可以帮助我呢?

Basically you're on the right track with your approach. 基本上,您的方法是正确的。 But you used the amerge filter (the same filter is named join in LIBAV). 但是您使用了amerge过滤器(在amerge ,相同的过滤器名为join )。 This filter combines individual mono streams into a single multichannel streams. 该过滤器将单个单声道流组合为单个多通道流。

From your description, it looks rather that you want to achieve something different: you want to mix those two mono streams into a single mono stream. 从您的描述看来,您似乎想要实现一些不同的东西:您要将这两个单声道流混合到一个单声道流中。 You can achieve that with the amix -Filter. 您可以使用amix来实现。

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

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