2

I am using ffmpeg on Mac to remove green background of video and add other background as image it is converting properly the video but auido is missing. I am using below command.

Am I doing anything wrong here?

ffmpeg -i bg.jpg -i input.mp4 -filter_complex "[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]" -map "[out]" output.mp4
Taher A. Ghaleb
  • 5,120
  • 5
  • 31
  • 44
AppleBee
  • 1,199
  • 12
  • 26

2 Answers2

10

I solved it my own.

ffmpeg -i bg.jpg -i input.mp4 -filter_complex "[1:v]chromakey=0x3BBD1E:0.1:0.2[ckout];[0:v][ckout]overlay[o]" -map [o] -map 1:a output.mp4

we need to add flags for audio.

AppleBee
  • 1,199
  • 12
  • 26
0

Once a map switch is added, only mapped streams are included. Add -map 1:a? -c:a copy

Gyan
  • 85,394
  • 9
  • 169
  • 201