Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

VGA Chroma Keying

Status
Not open for further replies.

dknguyen

Well-Known Member
Most Helpful Member
I was wondering if someone could help me answer a question of mine.

I want to make a HUD Overlay on some video and have found a vector graphics serial-VGA controller. I want to use this for my HUD overlay over top of some NTSC/PAL composite video. I was thinking if I got a NTSC/PAL->VGA converter, then I would have two VGA signals- my HUD and my video. I then want to use chroma keying to overlay them.

My question is this...I see 2:1 triple channel video multiplexers. Could I just make an RGB window comparison circuit for the HUD signal that would change it to the video signal whenever the chroma key matched? And switch it back whenever the chroma key does not? Are video switches fast and smooth enough to transition so frequently between horizontal and vertical lines of video this way to produce a seamless image?

EDIT: I just realized I would have to sync the two video sources. Aiya. But my question about switching the mux causing distortionns or tears in the video still stand.
 

ronsimpson

Well-Known Member
Most Helpful Member
I have used video multiplexers to switch between two sources or to add test.
I do not understand you idea on "window comparison & chroma key".
 

dknguyen

Well-Known Member
Most Helpful Member
-PC signal (VGA)
-Video signal (VGA, converted from NTSC)
-Suppose the chroma key colour is blue
-three 2:1 multiplexers that feed either the PC or Video signal to the output
-A window comparator that measures the analog voltage of the RGB signals on the PC signal, and whenever it is green, it sets the mux address to route the Video signal to the output, otherwise it routes the PC signal to the output.

So the result would be that the PC signal is routed to the output whenever the PC signal is NOT green. Whenever it is, the video signal is routed. Hopefully the result is like a chroma key blue-screen-style overlay of the PC screen over the video.
 
Last edited:

ronsimpson

Well-Known Member
Most Helpful Member
Both VGA signals must be in sync!!!!!
Doing this in VGA is much better than NTSC. In VGA green = (red approches 0, blue approches 0 and green is about 1 volt) Some VGA sources are AC coupled and the black level is lost, or not at 0 volts, so you will need to black level clamp. You will need some fast comparitors LM311 and some logic (001)=1.

If you only want to overlay text on video there are other ways.
-PC signal (VGA)
-Video signal (VGA, converted from NTSC)
-Suppose the chroma key colour is blue
-three 2:1 multiplexers that feed either the PC or Video signal to the output
-A window comparator that measures the analog voltage of the RGB signals on the PC signal, and whenever it is green, it sets the mux address to route the Video signal to the output, otherwise it routes the PC signal to the output.

So the result would be that the PC signal is routed to the output whenever the PC signal is NOT green. Whenever it is, the video signal is routed. Hopefully the result is like a chroma key blue-screen-style overlay of the PC screen over the video.
 

Mikebits

Well-Known Member
Could you do the switching during the blanking period?
 

ronsimpson

Well-Known Member
Most Helpful Member
No, I think he wants to switch pixel by pixel to overlay text. If not by the pixel he wants to defign a block anywhere that will show the other video. The 'switch' can happen at any location so blanking has nothing to do with this.
Could you do the switching during the blanking period?
 

Mikebits

Well-Known Member
Do you mean like a video mixer?
 

ronsimpson

Well-Known Member
Most Helpful Member
There is the problem, I don't really know. In post #1 HUD and OVERLAY and TEXT comes up. I searched these words and found examples of video text windows ontop of video.
I think he wants to convert NTSC to VGA. not easy
Then PLL the VGA to his PC. not easy
From the PC side every time the video from the PC is green the NTSC is displayed. When the PC is not green the PC-VGA is to be displayed. This way he can overlay PC text on a NTSC video and display it on a VGA monitor.
Do you mean like a video mixer?
 

dknguyen

Well-Known Member
Most Helpful Member
Both VGA signals must be in sync!!!!!
Doing this in VGA is much better than NTSC. In VGA green = (red approches 0, blue approches 0 and green is about 1 volt) Some VGA sources are AC coupled and the black level is lost, or not at 0 volts, so you will need to black level clamp. You will need some fast comparitors LM311 and some logic (001)=1.

If you only want to overlay text on video there are other ways.

Yeah I realized the bigger problem was syncing the two video signals...but that requires a frame buffer I think...which is beyond my ability right now.

Both VGA signals must be in sync!!!!!
Doing this in VGA is much better than NTSC. In VGA green = (red approches 0, blue approches 0 and green is about 1 volt) Some VGA sources are AC coupled and the black level is lost, or not at 0 volts, so you will need to black level clamp. You will need some fast comparitors LM311 and some logic (001)=1.

If you only want to overlay text on video there are other ways.

No, this is for vector graphics.

No, I think he wants to switch pixel by pixel to overlay text. If not by the pixel he wants to defign a block anywhere that will show the other video. The 'switch' can happen at any location so blanking has nothing to do with this.

Correct. Pixel by pixel swap.

There is the problem, I don't really know. In post #1 HUD and OVERLAY and TEXT comes up. I searched these words and found examples of video text windows ontop of video.
I think he wants to convert NTSC to VGA. not easy
Then PLL the VGA to his PC. not easy
From the PC side every time the video from the PC is green the NTSC is displayed. When the PC is not green the PC-VGA is to be displayed. This way he can overlay PC text on a NTSC video and display it on a VGA monitor.

Yeah I know =(. It seems I need 3 things. A NTSC->VGA Converter, a VGA synchronizer, and then finally the chromakey overlayer. I found a commercial product that does all 3, but this is for a UAV ground station so I was hoping to see if there was a more "OEM bare bones way" rather than ripping the PCB out of it's enclosures.

https://www.ambery.com/pcvgatovimeg.html

It would be easier if I could find a wireless video receiver that output VGA video, and super straightforward if it also had a sync input. But I've had absolutely zero luck finding any such that.
 
Last edited:

ronsimpson

Well-Known Member
Most Helpful Member
There are many different ways to add text on top of video. (NTSC or VGA) You can make it or buy it. The "text" board should sync to the signal.
The NTSC to VGA can be simple. It only needs a one line buffer. I have made them. I think I might have one I got from E-bay.
 

dknguyen

Well-Known Member
Most Helpful Member
I've found actualy overlay modules capable of graphics to be very very VERY expensive and inaccessible. The most accessible is BOB4 from Decade Engineering but it's not colour because it's a low cost solution that works with NTSC/PAL. The reason I was thinking of VGA instead was I found a serial-VGA graphics controller, the uVGAII. The reason I need to sync the two signals externaly if I make my own overlayer is the VGA controller that produces the overlay is meant to generate it's own independent . So it has it's own independent VGA signal. If i was making the graphics controller myself I could make it sync with the other video signal, but I'm not.

I'd love to make something that generates the graphics and overlays directly but the processors or FPGAS and memory required seem to be beyond my means.
 
Last edited:

ronsimpson

Well-Known Member
Most Helpful Member
There are many PIC to overlay examples that do not use FPGAs.
I think you can make PIC to VGA with color. Use the PIC to NTSC overlay idea but 2X faster and three outputs. The PIC syncs to H & V. Then it pulls up/down on the RGB lines when text is needed.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top