-1

I am working on the custom project which having mixer output. Mixer output having one frame buffer input for background image, i want to filter out the green color on the image and make it tarnsparency using gstreamer command. This transparency image is overlay onto incoming video of the mixer output so it streaming output should be tranparency and able to see the other video input in mixer output. Please provide the suggestion how to achive this.

i have tried below commad

gst-launch-1.0 filesrc location="background2.jpg" ! jpegdec ! videoconvert ! video/x-raw,format=ARGB ! alpha method=custom target-r=80 target-g=255 target-b=80 angle=90 alpha=1.0 ! videoconvert ! video/x-raw,format=UYVY ! filesink location=/dev/fb0

Above command is filter out the green color on image but not make it transpraency output. when am overlay this image onto other mixer video input, am not able to see the video input which is beside this image

i want to know gstreamer having this feature to make the image transparency or not

2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Sep 24, 2023 at 5:24
  • i have the mixer output in my design which have the many video inputs and do the mixing and layer feature. Top layer of the mixer is graphic layer which is stream from frame buffer using gstreamer command. i want to achieve the chroma keying feature using gstreamer and able to the see the output which is present behind the graphic layer . Commented Oct 6, 2023 at 5:55

1 Answer 1

0

Your problem is that you are converting into UYVY with videoconvert, so it renders onto a black background. You would use a compositor able to manage alpha beforehand, such as:

gst-launch-1.0 -v \
videotestsrc ! video/x-raw,format=RGBA,framerate=30/1 ! queue ! comp.sink_0 \
filesrc location=background2.jpg ! jpegdec ! imagefreeze ! videoconvert ! video/x-raw,format=RGBA,framerate=30/1 ! alpha method=custom target-r=80 target-g=255 target-b=80 angle=90 alpha=1.0 ! queue ! comp.sink_1 \
compositor name=comp \
  sink_0::xpos=0  sink_0::ypos=0  sink_0::zorder=1 \
  sink_1::xpos=50 sink_1::ypos=50 sink_1::zorder=2 \
  ! videoconvert ! autovideosink
Sign up to request clarification or add additional context in comments.

1 Comment

this command will apply the transparency on .jpg file but the compositor background always be opaque. my requirment is to get the transparency output and able to backgroud window screen which is behind my gstreamer output window

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.