如何使用FFMPEG覆盖XSTACK MOSAICS上的波形并指定播放的特定音频
我想制作一个标题为“流”的镶嵌物,1)指定要播放的音频流以及2)在每个视频瓷砖底部的覆盖波形,以供其所属的音频。
我成功地使用了以下代码来创建标题为“流媒体”。
但是:
- 我很难弄清楚如何仅指定特定音频源之一。 不想混合它们,我只想指定音频[A0],[A1]或[A2]等
我找到了Amix,但我真的
- 。每个瓷砖的视频底部形成波浪。我努力地试图弄清楚将表演波打入组合中。是否可以?
我希望每个瓷砖看起来都这样,但是由于这些是RTMP流,因此他们需要在每个流中动态播放匹配的波形。 https://dragonquest64.blogspot.com/2020/2020/01/501/501/ffmpeg--peg-peg- Audio-Waveform.html
如果有人可以将我指向正确的方向,那就太好了。我已经接近了,但是我对所有这些都非常新手,并且已经花费的时间比我应该拥有的更多,因此会喜欢一点帮助。
ffmpeg \
-i rtmp://my.cdn.com/srcEncoders/STREAM-1 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-2 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-3 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-4 \
-filter_complex " \
[0:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-1:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a0]; \
[1:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-2:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a1]; \
[2:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-3:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a2]; \
[3:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-4:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a3]; \
[a0][a1][a2][a3]xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0[out]; \
amix=inputs=1
" \
-map "[out]" \
-c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -f mpegts "udp://127.0.0.1:1234?pkt_size=1316"
I would like to make a mosaic of multiple titled streams, 1) specifying which of the audio streams to play and 2) overlay waveforms at the bottom of each of the video tiles for the audio that they belong to.
I'm successfully able to create the titled mosaic of streams with the code below.
However:
- I'm having a hard time figuring out how to specify just one of the specific audio sources. I found amix, but I don't really want to mix them, I just want to specify audio [a0], or [a1], or [a2], etc.
and
- I'm having a hard time figuring out how to overlay the wave forms at the bottom of the video for each of the tiles. I struggled trying to figure out putting showwaves into the mix. Is it possible?
I want each tile to look like this, but since these are rtmp streams, they need to play-out the matching waveforms dynamically with each stream. https://dragonquest64.blogspot.com/2020/01/ffmpeg-audio-waveform.html
If someone could point me in the right direction, that would be great. I'm getting close, but I'm pretty new to all of this, and have already spent way more time than I should have, so would love a little help.
ffmpeg \
-i rtmp://my.cdn.com/srcEncoders/STREAM-1 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-2 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-3 \
-i rtmp://my.cdn.com/srcEncoders/STREAM-4 \
-filter_complex " \
[0:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-1:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a0]; \
[1:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-2:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a1]; \
[2:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-3:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a2]; \
[3:v] setpts=PTS-STARTPTS, scale=qvga \
, drawtext=text=STREAM-4:fontsize=20:x=10:y=10:fontcolor=white:box=1:[email protected]:boxborderw=5 [a3]; \
[a0][a1][a2][a3]xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0[out]; \
amix=inputs=1
" \
-map "[out]" \
-c:v libx264 -b:v 1000k -g 30 -keyint_min 120 -profile:v baseline -preset veryfast -f mpegts "udp://127.0.0.1:1234?pkt_size=1316"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅指定特定音频流之一:只需使用另一个
-map
选项,就像使用视频流一样指定音频流。将
放入showwaves
进入混合物:您需要每个音频输入的单独过滤链。以下是命令的粗略草图:
将framerate
r
和frameizes
showwaves的选项
expoction 过滤器。对于音频,我只是使用了第一个输入,请从0:a 更改流说明符以选择另一个输入
Specifying just one of the specific audio stream: Just use another
-map
option to specify an audio stream just as you are doing with the video stream.Putting
showwaves
into the mix: You need a separate filterchain for each of audio inputs.Below is a rough sketch of the command:
Set the framerate
r
and framesizes
options ofshowwaves
filters to your liking.For the audio, I just used the first input's, change the stream specifier from
0:a
to select another input