gmf icon indicating copy to clipboard operation
gmf copied to clipboard

Chromakey Filter

Open hasnhasan opened this issue 3 years ago • 2 comments

Hello,

Do you have an example for the Chromakey Filter?

hasnhasan avatar Sep 23 '22 09:09 hasnhasan

Hello, @hasnhasan

Most filters are working pretty straightforward - just

  • create new one with gmf.NewFilter() and pass filter description
  • put frame into with filter.AddFrame()
  • get filtered frame with filter.GetFram()

No needs for extra stuff. You can get any example from examples/ and add filter there and it will work.

Watermark example is a little bit tricky, that is why it's there.

3d0c avatar Sep 25 '22 12:09 3d0c

I want to apply chromakey to the data coming from rtmp server. Then I want to give many different overlays to the transparent stream and send it to the rtmp client.

Example Code;

ffmpeg -i sources/source.mp4 -vf "chromakey=0x276100:0.060:0,despill=green=-1,boxblur=0:0:0:0:3:2" -c:v prores -pix_fmt yuva444p10le transparent.mkv -y Overlay;

ffmpeg -i transparent.mkv -stream_loop 1 -i mask1.mp4 -filter_complex "[1:v][0:v]overlay[out]" -map "[out]" -f flv rtmp://127.0.0.1/live/test1

ffmpeg -i transparent.mkv -stream_loop 1 -i mask2.mp4 -filter_complex "[1:v][0:v]overlay[out]" -map "[out]" -f flv rtmp://127.0.0.1/live/test2...

hasnhasan avatar Jul 17 '23 22:07 hasnhasan