0

I have two WebM files, both have video and audio.

I want to insert the audio from one WebM file into the other so that the final WebM file has two audio "streams" playing simultaneously with the video.

Is it possible to achieve this programatically? Preferably with Ruby, or if not with a command line interface, maybe ffmpeg?

andy
  • 8,775
  • 13
  • 77
  • 122

1 Answers1

2

Using ffmpeg

ffmpeg -i first.webm -i second.webm -filter_complex "[0:a][1:a]amix[a]" -c:v copy -map 0:v -map "[a]" mixed.webm

This will output the video of the first input along with the audio mix. Check manual for amix for tweaks to apply. This will also apply the default audio encoding parameters for WebM.

Gyan
  • 85,394
  • 9
  • 169
  • 201