Superimposing audio waves on video bottom

Steam recording with RTMPDump or FFmpeg.
Post Reply
knzoltan
Posts: 1
Joined: Mon Apr 02, 2018 7:40 am

Superimposing audio waves on video bottom

Post by knzoltan » Mon Apr 02, 2018 7:45 am

Hi,

I'd like to overlay the audio as a waveform coming from an axis camera's stream.
I've started to read the documentation, but It's quiet complex. For testing I use a test stream. So far I managed to pad a bottom:

Code: Select all

#!/bin/bash

stream="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"
padbottom=40

# 1 enlarging the video
#ffmpeg -i "$stream" -vf "pad=width=240:height=160+$padbottom:x=0:y=0:color=A9F5A9" videoPart.mp4

# 2 creating a waveform out of the video
ffmpeg -i $stream -filter_complex "[0:a]showwaves=s=240x$padbottom:mode=line" audioPart.mp4
I'd like to merge the 2 ffmpeg commands into one single comman producing a videofile with its audio superimposed on the bottom,
similar to this one:

https://www.youtube.com/watch?v=BG9SYC0wWYw

As far as I understand the filter_complex documentation, this could be achieved by these steps:

1. split the incoming stream into 2 streams. (which I don't know how to do)
2. padding the 1st stream, (enlarging it by 40 pixels)
3. apply the waveform or showvolume on the second stream, creating a 240 x 40 pixel video out of it
4. merging the 2 stream together. (but how? According to the documentation 'split' is for cutting a media file, at least to my understaning) :roll:

Could you please help me?

Thanks,

Zolee

pandy
Posts: 89
Joined: Mon Feb 24, 2014 1:46 pm

Re: Superimposing audio waves on video bottom

Post by pandy » Fri Apr 20, 2018 3:14 pm

At first:
https://trac.ffmpeg.org/wiki/Waveform

Perhaps this will work (sorry had no time to test).

Code: Select all

-filter_complex "[0:v]pad=width=240:height=160+$padbottom:x=0:y=0:color=A9F5A9[vout];[0:a]showwaves=s=240x$padbottom:mode=line[aout];[vout][out]overlay=format=auto:w=0:h=0"

Post Reply