Progressive to Interlaced Converter - Page 1
Forum section: electronics / projects

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 16, 2019, 12:26:10 pm
content: I am wondering if such a device exists? If not I would like to build one, after all all it has to do is switch on and off at the right time (which is the hard bit).For example, I have several CRT TVs which I still use and I want to hook up a PC to them to run Kodi clients.The TVs accept 576i 50Hz via RGBS(via SCART) PALThe PCs output 576p 50Hz via RGBS(via DSUB 15 VGA)I already made an adapter cable and I am ending up with a sliding bar effect on the screen. The image is there but the lines are sliding one after the other.So the Vsync is correct but the Hsync is twice the speed it should be.My idea so far:One could use a LM1881 to get the odd/even lines and seperate the Vsync. Then a logic circuit could be used to seperate the H sync from the H/Vsync pin to get a clean H sync signal.Then using the clean H sync, the circuit would have to switch off the sync output to ignore all the even lines on the first frame, then ignore the odd lines on the second and so on....While the sync is turned off, 3 transistors could be used to ground the RGB lines to turn them off at the same time as the ignored lines.I think this would be a useful device, it would be great to support 480p too for NTSC compatibility but we only use PAL on CRTs in the UK.Is there a microcontroller that can switch fast enough for this? or perhaps dedicated harware is best?Any thoughts on this?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 16, 2019, 02:24:09 pm
content: It's not so much the speed (analog TV is only ~MHz BW) as the storage. A frame is, what, a few hundred kB? You need to store at least half that (one full field), plus an extra one half line. Play back the first line of the first field, then the just-recorded line of the current field (which will have finished receiving just in time to transmit; more likely, you'll store the whole line and not mind the extra half-line requirement), then the second line, then the just-recorded second line, then... Obviously, alternating down as you go, at double the output bandwidth.Mid-tier ARM MCUs have about as much RAM onboard, give or take exact bandwidth, bit depth and encoding. And they run in the 160MHz range which is enough for a dozen or so instructions per sample, which may facilitate some minor encoding to save on space. Figure about $10 for the chip, and, who knows, several months to write it..?Might be easier to write on an FPGA, a mid-tier one of which might run $20-40, would have enough block RAM onboard to hold a frame or so, andway morethan enough logic to handle any decoding and encoding you might need to support the video format and to save RAM.The PC can't just use a capture card?Tim

author: Benta
author_rank: Super Contributor
timestamp: October 16, 2019, 03:46:45 pm
content: The LM1881 will only give you a correct even/odd output if it is fed with interlaced video. That's not the case in your scenario.

author: james_s
author_rank: Super Contributor
timestamp: October 16, 2019, 04:10:07 pm
content: You used to be able to get VGA to TV converter boxes for around $25, can you not still get those? Some PC video cards can be tweaked to produce nonstandard timing too. Another option is a Raspberri Pi, it has a composite output and a Kodi client.

author: soldar
author_rank: Super Contributor
timestamp: October 16, 2019, 04:13:29 pm
content: I believe a lot of those "de-interlacers" merely dropped one field and interpolated the other field.

author: ejeffrey
author_rank: Super Contributor
timestamp: October 16, 2019, 06:29:16 pm
content: Quote from: T3sl4co1l on October 16, 2019, 02:24:09 pmIt sounds like he wants to go progressive to interlaced at the same refresh rate so it is actually much easier than that. It is just dropping every other scan line and playing back the remaining ones at half the speed. In that case you only need a single scanline of buffer.

author: Benta
author_rank: Super Contributor
timestamp: October 16, 2019, 07:10:19 pm
content: Quote from: ejeffrey on October 16, 2019, 06:29:16 pm

author: Benta
author_rank: Super Contributor
timestamp: October 16, 2019, 07:25:30 pm
content: The correct way of going from progressive to interlaced scan is to shift the Vsync half a line back and forth. This has to done in sync with the Hsync.Unfortunately, VGA outputs do not provide serration or equalization pulses, so you'll have to create a synchronous clock at double the Hsync rate to precisely move the Vsync pulse.A PLL does the trick, together with a bit of logic: FFs + gating.The first and last scan line will look crappy, but they're normally outside the scan area.BTW: it's an open question whether your TV will accept interlaced video without serration/equalization pulses.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 03:54:33 pm
content: Quote from: ejeffrey on October 16, 2019, 06:29:16 pmYes exactly. Ideally I would not have to buffer the signal at all if possibleInstead of storing the scanlines then playing them back would it be possible to just 'turn off' the even scanlines on the first frame then on the second frame 'turn off' the odd scanlines? If that makes sense?

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 03:57:36 pm
content: Looking up about interlaced signals, the H sync frequency seems to be exactly half of a progressive signal.I saw one piece of information that said you can just divide the H sync in half by ignoring every other pulse, but I don't believe this would be true interlaced video because it would be getting the same field on every frame, whereas my understanding is it should be getting the odd field from frame 1 then the even field from frame 2 etc..

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 04:11:41 pm
content: Quote from: Benta on October 16, 2019, 07:25:30 pmThe input is RGBS input with 4 lines. So the first step is to make a circuit to get a clean H sync and a clean V sync. What would be the best way to achieve this?By PLL do you mean a Phase Locked Loop? I only touched briefly on these about 10 years ago so I do not know much about them.From memory I think we used a CD4046. Would this be suitable for this purpose?I think I remember someone using the NE555 as a PLL too.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 04:19:08 pm
content: Just found this.https://circuitswiring.com/vga-to-tv-scart/Can anyone shed some light on this schematic?

author: helius
author_rank: Super Contributor
timestamp: October 17, 2019, 04:42:14 pm
content: To get readable text or computer graphics out of this type of converter, it must perform spatial and temporal convolution.Of course, it is possible to discard every other line, but that simply throws away information and causes visual artefacts.

author: ejeffrey
author_rank: Super Contributor
timestamp: October 17, 2019, 04:47:36 pm
content: Quote from: paul_g_787 on October 17, 2019, 03:54:33 pmI don't know what typical CRT TVs will accept but you need storage to generate a correct signal. The duration of a single scanline for 578i vs 578p at 50 Hz is different by a factor of two.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 04:52:08 pm
content: Quote from: ejeffrey on October 17, 2019, 04:47:36 pmSo essentially stretching the scanline out so it take twice the time to draw it on the screen?

author: Miyuki
author_rank: Frequent Contributor
timestamp: October 17, 2019, 04:55:52 pm
content: VGA cards used to support interlaced output on vga portIt was just matter of drivers and commonly not user friendly accesible config to se those modes

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 17, 2019, 06:39:47 pm
content: Yeah, it's twice the bandwidth so you have to lose data. Pulling down every other (you'd still need a line's worth of storage to resample it) is about all you can do.There are refinements of course, like capturing consecutive frames and filtering them, alternating which lines are pulled down. The same deinterlace filters that are used for capturing video, work the same in reverse as antialiasing filters.Tim

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 17, 2019, 07:38:01 pm
content: Another way of looking at this.I have this cheap device from ebay. It takes HDMI in and outputs composite video / stereo audio. It works great but composite video quality is utter is bullsh*t and I cannot read the text on the screen.https://www.ebay.co.uk/itm/1080P-HDMI-To-SCART-Composite-Video-Scaler-Converter-Audio-Adapter-for-DVD-SKY-/202568495043?_trksid=p2349526.m4383.l10137.c10&nordt=true&rt=nc&orig_cvip=trueThere are two ICs inside. One right next to the HDMI which is a CM6616A and I cannot find a datasheet for this but if I had to guess, it is a HDMI to RGB chip perhaps?This second IC is a MS1835. I cannot find a pin-out for this IC but have a look at the block diagram on their website:http://en.macrosilicon.com/info.asp?base_id=2&third_id=17Now it does not appear that this IC has RGB out, only composite or S video out. Unfortunately they haven't even wired in the S video on the device as I only get a black and white image when trying it on the TV.I am unsure if there is a way this device can be modified to output RGB.I am wondering what would happen if I connected the RGB input pins to the RGB pins on the SCART output. would this be possible?Is anyone able to find the full datasheet for this MS1835?Surely there must be another IC similar to this out there, a video encoder that that can take the RGB from a PC and output RGBS with a 15.625KHz output for PAL?

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 28, 2019, 05:29:46 pm
content: Quote from: james_s on October 16, 2019, 04:10:07 pmYes you can still get those but they, like the raspberry pi are only composite which is absolutely disgusting on the screen and the text is so blurry it is almost unreadable.Now if there was one of these VGA to TV converters that simply output the RGB and sync signals seperately before they are combined into composite then this would give a perfectly good image via RGB SCART and would be exactly what I am looking for.

author: Benta
author_rank: Super Contributor
timestamp: October 28, 2019, 07:44:01 pm
content: What you need to realise is, that 95% of commercial European TVs donothave RGB inputs*. Check the repair schematics.The SCART specification is wonderful, but almost always implemented as CBVS input (and output) only.Your blurred text problem is because you expect VGA resolution from a bandwidth limited analogue video signal, RGB or CVBS both. It just won't work.(*) we're still better off than in the US, where they have no SCART inputs at all.

author: helius
author_rank: Super Contributor
timestamp: October 28, 2019, 08:36:44 pm
content: When the inputs are on RCA connectors, you can at least tell quickly what is supported: CVBS only? S-Video? RGB and/or component? No guessing and you don't need to "check the repair schematics" to find this information.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 28, 2019, 10:10:58 pm
content: Quote from: Benta on October 28, 2019, 07:44:01 pmI did not mention anything to do with the resolution. The VGA output is giving It is at 576 lines which is the same as composite video. My problem is it is progessive and not interlaced and the CRT TVs in the UK can only accept interlaced signals on Composite / S-video and RGB SCART.The blurring is the cross-talk between the Red / Green / Blue and Sync signals sharing the common conductor. The reason the VGA to composite devices are rubbish is because of the combining of the signals which the TV has to separate again.I have also observed the blurring via Composite (CVBS) on the PlayStation 2, Playstation 3, Mega Drive 2 and my Sony DVD player. By using said devices RGB output and using a SCART connection which has 4 seperate coaxial cores for RGB and Sync the blurring is not present as there is no cross-talk, therefore a sharp image is seen with none of the blurring. (not to mention the colour-loss that composite suffers from too).So what I am trying to find is one of those converters from VGA but tapping the RGB signals out before then get combined into composite.The converter I have accepts progressive in, and scales the signal to 576i (or 480i), but unfortunately because it is in an SOP8 IC, I cannot tap the RGB signals out before they are combined to composite.Ideal option here is to find an IC which has the same function but with RGB out.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: October 28, 2019, 10:18:14 pm
content: Quote from: helius on October 28, 2019, 08:36:44 pmBy simply looking at the SCART connector pins on the PCB I can see that the only pins that have traces are composite and audio (and blanking signal).https://en.wikipedia.org/wiki/SCARTSCART is not that complicated when you look at it. The idea was to simplify connecting devices by only having one cable.