AppleBee
AppleBee

Reputation: 1219

chromakey: ffmpeg green color video removal

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

Upvotes: 2

Views: 6182

Answers (2)

AppleBee
AppleBee

Reputation: 1219

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.

Upvotes: 9

Gyan
Gyan

Reputation: 93028

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

Upvotes: 0

Related Questions