Author Topic: Progressive to Interlaced Converter  (Read 6098 times)

0 Members and 1 Guest are viewing this topic.

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Progressive to Interlaced Converter
« on: October 16, 2019, 12:26:10 pm »
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) PAL
The 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?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Progressive to Interlaced Converter
« Reply #1 on: October 16, 2019, 02:24:09 pm »
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, and way more than 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
« Last Edit: October 16, 2019, 02:27:35 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Tantratron

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6933
  • Country: de
Re: Progressive to Interlaced Converter
« Reply #2 on: October 16, 2019, 03:46:45 pm »
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.

 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Progressive to Interlaced Converter
« Reply #3 on: October 16, 2019, 04:10:07 pm »
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.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3634
  • Country: es
Re: Progressive to Interlaced Converter
« Reply #4 on: October 16, 2019, 04:13:29 pm »
I believe a lot of those "de-interlacers" merely dropped one field and interpolated the other field.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 4466
  • Country: us
Re: Progressive to Interlaced Converter
« Reply #5 on: October 16, 2019, 06:29:16 pm »
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.

It 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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6933
  • Country: de
Re: Progressive to Interlaced Converter
« Reply #6 on: October 16, 2019, 07:10:19 pm »
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.

It 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.

???     :-//

 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6933
  • Country: de
Re: Progressive to Interlaced Converter
« Reply #7 on: October 16, 2019, 07:25:30 pm »
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.

« Last Edit: October 16, 2019, 07:44:56 pm by Benta »
 
The following users thanked this post: Tantratron

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #8 on: October 17, 2019, 03:54:33 pm »
It 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.

Yes exactly. Ideally I would not have to buffer the signal at all if possible

Instead 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?
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #9 on: October 17, 2019, 03:57:36 pm »
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..
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #10 on: October 17, 2019, 04:11:41 pm »
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.

The 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.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #11 on: October 17, 2019, 04:19:08 pm »
Just found this.

https://circuitswiring.com/vga-to-tv-scart/

Can anyone shed some light on this schematic?
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: Progressive to Interlaced Converter
« Reply #12 on: October 17, 2019, 04:42:14 pm »
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.
 
The following users thanked this post: Tantratron

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 4466
  • Country: us
Re: Progressive to Interlaced Converter
« Reply #13 on: October 17, 2019, 04:47:36 pm »
It 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.

Yes exactly. Ideally I would not have to buffer the signal at all if possible

Instead 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?

I 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.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #14 on: October 17, 2019, 04:52:08 pm »
It 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.

Yes exactly. Ideally I would not have to buffer the signal at all if possible

Instead 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?

I 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.

So essentially stretching the scanline out so it take twice the time to draw it on the screen?
 

Offline Miyuki

  • Frequent Contributor
  • **
  • Posts: 910
  • Country: cz
    • Me on youtube
Re: Progressive to Interlaced Converter
« Reply #15 on: October 17, 2019, 04:55:52 pm »
VGA cards used to support interlaced output on vga port
It was just matter of drivers and commonly not user friendly accesible config to se those modes
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Progressive to Interlaced Converter
« Reply #16 on: October 17, 2019, 06:39:47 pm »
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
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #17 on: October 17, 2019, 07:38:01 pm »
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=true


There 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=17

Now 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?

 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #18 on: October 28, 2019, 05:29:46 pm »
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.

Yes 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.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6933
  • Country: de
Re: Progressive to Interlaced Converter
« Reply #19 on: October 28, 2019, 07:44:01 pm »
What you need to realise is, that 95% of commercial European TVs do not have 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.
« Last Edit: October 28, 2019, 07:46:18 pm by Benta »
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: Progressive to Interlaced Converter
« Reply #20 on: October 28, 2019, 08:36:44 pm »
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.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #21 on: October 28, 2019, 10:10:58 pm »
What you need to realise is, that 95% of commercial European TVs do not have 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.

I 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.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Progressive to Interlaced Converter
« Reply #22 on: October 28, 2019, 10:18:14 pm »
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.

By 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/SCART

SCART is not that complicated when you look at it. The idea was to simplify connecting devices by only having one cable.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf