Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromakey Filter #156

Open
hasnhasan opened this issue Sep 23, 2022 · 2 comments
Open

Chromakey Filter #156

hasnhasan opened this issue Sep 23, 2022 · 2 comments

Comments

@hasnhasan
Copy link

Hello,

Do you have an example for the Chromakey Filter?

@3d0c
Copy link
Owner

3d0c commented Sep 25, 2022

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.

@hasnhasan
Copy link
Author

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants