[RESOLVED] HDMI Input to Output with color keying

Post Reply
irisg_guy
Posts: 14
Joined: Wed Jan 30, 2019 1:50 pm
4kOpen Owner: Yes
[RESOLVED] HDMI Input to Output with color keying

Post by irisg_guy » Wed Jan 30, 2019 1:54 pm

Hi,
Anybody know if it is possible to read from the HDMI input and use a color key to allow portions of the HDMI input be displayed on the HDMI output.

I want to mix HDMI input with a GUI I will create.

Thanks

dan.truitt
Posts: 4
Joined: Thu Jan 31, 2019 8:08 pm
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by dan.truitt » Fri Feb 01, 2019 4:55 pm

Try looking for a file called stmvout.h there are extended V4L2 control ids for the following:
/* extended controls are following here */
/* colorkey controls */
V4L2_CID_STM_CKEY_ENABLE,
/* enum _V4L2_CID_STM_CKEY_ENABLE_FLAGS
(enable or disable) (immediateley or on
next queued & displayed buffer) */
V4L2_CID_STM_CKEY_FORMAT, /* enum _V4L2_CID_STM_CKEY_FORMAT_MODE
format of V4L2_CID_STM_CKEY_[MIN|MAX]VAL */
V4L2_CID_STM_CKEY_R_CR_MODE, /* enum _V4L2_CID_STM_CKEY_COLOR_COMPONENT_MODE */
V4L2_CID_STM_CKEY_G_Y_MODE, /* enum _V4L2_CID_STM_CKEY_COLOR_COMPONENT_MODE */
V4L2_CID_STM_CKEY_B_CB_MODE, /* enum _V4L2_CID_STM_CKEY_COLOR_COMPONENT_MODE */
These controls exist on the v4l2 device with the card name "STMicroelectronics" and driver name "Planes"

Best regards

User avatar
attie
Posts: 21
Joined: Thu May 17, 2018 11:40 am
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by attie » Tue Feb 05, 2019 1:17 pm

Hi irisg_guy,

Yes, this is indeed possible.

We currently use this technique with our port of the Parole media player to effectively "poke a hole" in the UI / desktop for the video to appear through.

We've settled on #080810 as the "transparent" color - so anywhere this appears will actually let video from other planes through. This is configured at boot with the following line in /etc/init.d/st-modules - specifically the --color-key argument.

Code: Select all

/usr/bin/stfbset -a 255 -M 0x00000000 --color-key="1 0 0x080810 0x080810"
Try the following:
  • Setup the HDMI source and connect it to the HDMI Rx port
  • Follow the wiki page to configure the pipelines with media-ctl, and run hdmirx-capture
  • Open the attached image in an image viewer (it is just this solid color)
I have produced a video to demonstrate the result here: https://www.youtube.com/watch?v=l8-2jimTOQ8

Attie
Attachments
transparent.png
transparent.png (997 Bytes) Viewed 827 times

irisg_guy
Posts: 14
Joined: Wed Jan 30, 2019 1:50 pm
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by irisg_guy » Wed Feb 06, 2019 12:46 pm

Thanks guys... I have just received the board here so I am about to do some testing...

irisg_guy
Posts: 14
Joined: Wed Jan 30, 2019 1:50 pm
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by irisg_guy » Thu Feb 07, 2019 5:34 pm

That worked perfect... Thanks

User avatar
attie
Posts: 21
Joined: Thu May 17, 2018 11:40 am
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by attie » Tue Feb 12, 2019 11:00 am

No problem - pleased to hear it!

User avatar
attie
Posts: 21
Joined: Thu May 17, 2018 11:40 am
4kOpen Owner: Yes
Re: HDMI Input to Output with color keying

Post by attie » Tue Feb 12, 2019 5:07 pm

I've written a Wiki page on this topic, here: https://www.4kopen.com/wiki/advanced-ti ... lor-keying


Post Reply