# Hardware composite video overlay

I am building a setup to make more inputs on a composite monitor (in fact it's a VGA monitor with a composite-to-VGA converter on it but the overlay needs to be composite) and everything will be controlled via a microcontroller.

I want to be able to show a menu that will tell me what source is selected. I made everything and it does work, but when I open the menu the whole screen does blank and only my menu works (witch is normal because it currently have it's own composite signal and when I open it up the relay of the input is turned off to turn on the one of the menu).

Can anybody guides me in the process?

The cheaper working solution will be the best one.

• Generating video signal is not a job appropriate for most microcontrollers (unless they are specifically designed for that). – Eugene Sh. Dec 19 '19 at 21:30
• Asking "Does anybody knows a way to do this?" makes this into a "please design this for me" question. Sorry, but this is not a electronics design house. – Oldfart Dec 19 '19 at 21:32
• @Oldfart I do only say this in case someone could guide me into this. I didn't find anything that does this online. – Spyro 999 Dec 19 '19 at 21:37
• @Hearth if you already have composite video, it can be done entirely in the analogueish domain – pjc50 Dec 19 '19 at 22:00
• @Oldfart, actually Does anybody knows a way to do this? is a pointless yes/no question that cannot have any other answer than yes – jsotola Dec 20 '19 at 0:41

The normal solution is a "genlock": sync your system to the incoming video, then selectively replace bits of it.

You will need:

• sync separation (single chip solution)
• fast analogue switch between your signal and theirs
• recombine the signals (or just output them as S-Video)

Edit: or there's almost certainly a single chip solution for the whole thing. Here's a mono version. https://www.sparkfun.com/products/retired/9168

• The spark fun product is exactly what I need. I'll try to find schematics for it thank you!! – Spyro 999 Dec 19 '19 at 22:06
• If anybody has ideas about another way of doing it I'll examine it – Spyro 999 Dec 19 '19 at 22:07

Are you passing the original video signal through? You probably need to use some analog switches switch the video output back and forth between your MCU output and the original feed, depending on when an overlay should be happening. If you can eek out the processing power to switch the video signal in and out with some switches and maintain proper timing it can work. That's basically on-the-fly video processing which is FPGA/DSP territory.

You won't have transparency, but that's a whole other can of worms and you can essentially completely forget about that with an MCU unless it can somehow also spare the processing power to read the original video feed on the fly and mix it with your overlay before overriding the output.

The only reason I offer a suggestion instead of saying to not use just an MCU is because he already has VGA generation working, just not the overlay part.

• I do not really care about transparency the only thing I want is an overlay of some sort. Is there any FPGA/DSP project out there that is doing something similar? I do not know how to use thievery well. – Spyro 999 Dec 19 '19 at 21:58
• @Spyro999 I know of none, but to be honest, once you have the genlock built, you could try to see if your current MCU can handle it. If it can't run a second MCU dedicated to just switching the video output between your original video feed and MCU overlay feed. Assuming the overlay is an opaque block, it always stays in the same place on the screen all the time right? So the to MCUs can predict what the other MCU will do based on the genlock. If you have it gotten as much as you have and don't need any more complicated overlay, I would stick with what you have rather than jumping to FPGA/DSP – DKNguyen Dec 19 '19 at 22:03
• The problème is that I do mot have MCUs with analog input – Spyro 999 Dec 20 '19 at 0:24
• @Spyro999 I never said you needed one. Your MCU isn't fast enough to read and process the video signal on the fly anyways. But it does have digital output pins that can drive analog switches to switch the video output back and forth between the original video feed and your overlay outputs on your MCU. – DKNguyen Dec 20 '19 at 0:33