Log in

View Full Version : New Idea: C4All in one pass!


jmac698
7th March 2006, 20:45
Programmers, I need some help. Do you think it's possible, in directshow, to make a capcard switch video sources, stably on each field or frame?
If so, by an inventive technique, I can record component video directly in realtime.
This is how it works: the source must be 24p with 3:2 pulldown. This means each field is repeated 2 or 3 times. So now we have two chances to record that field.
Now the wiring: first assume that svideo output and component output are both active on your satellite/dvd/cable at the same time. Connect the svideo to your capcard, and the P+Pr to your composite. We will be using the full color signal from svideo, plus the b/w part of the combination, P+Pr.
We record one field on svideo, one field on component (on composite in). Now we have copies in both ways.
Later, the program decodes the svideo to Y,U,V and merges in the Pr. You need to find (svideo Y) - (P+Pr) = Pr.
The result is Y,Pr in full bandwidth, Pb in svideo bandwidth.
You would have to take some care to deinterlace this, but I think there's enough info there. On bad pulldown just revert to motion compensated svideo.

You could also record two shows at once!

Qjimbo
7th March 2006, 23:42
It'd require custom drivers certainly. For a BT card there are the open source btwincap drivers, so it'd be possible to look into modifying those, I don't know what the hardware limitations are regarding the speed of switching though. And you wouldn't be able to record two shows because they both use the same audio lines.

jmac698
8th March 2006, 00:13
As far as switching speed, the switching is in the chip itself, and should be instant. There may be some lag in sending the command over PCI, but there's lots of time to do it, maybe almost 1ms of unused lines with no important info.
As for the audio, I forgot about that :) You could use the capcard input plus the soundcard input, everyone has that so no problem. However, worse is that two video sources are out of sync, you could cap one full frame and one random part of the other source.
Capping from the same source is in sync, however.
It could be very simple if someone knew how to look at the driver source. It's probably just a few lines of code. Someone would have to think it's worth it though.

jmac698
10th March 2006, 01:28
I found out the cx2584x series chips have just two ADC, but it can record component. It does this by using an internal very high speed switch feeding to one ADC, that can read two signals at once, time multiplexed.
For sure, to go to this trouble, it would be better to make some driver that enables component mode, and some wiring to the card for the inputs. Possibly, no modz are necessary, just use the existing connectors with a special cable.

rfmmars
10th March 2006, 01:44
I found out the cx2584x series chips have just two ADC, but it can record component. It does this by using an internal very high speed switch feeding to one ADC, that can read two signals at once, time multiplexed.
For sure, to go to this trouble, it would be better to make some driver that enables component mode, and some wiring to the card for the inputs. Possibly, no modz are necessary, just use the existing connectors with a special cable.

Take a look at this to see if it could be modified for your system.

http://cgi.ebay.com/4-Channel-PCI-DVR-Video-Capture-Card-for-CCTV_W0QQitemZ5877725153QQcategoryZ48632QQrdZ1QQcmdZViewItem


Richard

jmac698
10th March 2006, 03:51
More info http://www.itrademarket.com/worldamax/62518
It turns out, that this doesn't matter anymore, as most modern chips have a function called "fast locking". The purpose, is to sell the chip to the camera market. The feature records the next possible field immediately. It is definitely possible to record alternate fields from two synchronized sources with no loss, and it is fully supported in hardware.
The fast locking algorithm locks onto the first vertical sync it encounters, regardless
of where the internal timing counters expect a vertical sync to occur. It also disables
the hysteresis that is used for the field detection logic. As soon as the even/odd field is
detected, the field signal is updated to reflect that status.

In summary, with a driver mod, it is possible to enable component in two ways, one is recording two video inputs every other field, the other way enables true component if available on the chip. It is possible, further, that only a special cable connection is need, with no hardware modz.

If I could write drivers I'd be dangerous :)

Qjimbo
10th March 2006, 11:43
So essentially, you can let the card automatically detect the refresh rate, thats pretty cool. I suppose you could could construct a device that allowed you to plug in the component connectors and sync, and essentially have a simple circuit that would flip them continuously, making the TV card run at 3*50hz for pal or 3*60hz for ntsc... Thats running the card a LOT faster than what it's designed to do, but it might work.

jmac698
10th March 2006, 15:44
I think I need to explain better,
Let's say I have two inputs, A and B. I can record A for 1/60, record B for 1/60, record A for 1/60... this is one field alternately from each input. But remember while I'm recording B I missed a field from A. I'm not "overclocking" or anything.
Now remember about 3:2 pulldown, this means 24 frames of film are shown on 60 fields of video. 60/24=2.5, so a frame of film must be shown over 2.5 fields of video, on average. 3 fields, then 2 fields, then 3 fields... will average to 2.5 fields.
So I'm recording the same film on A and B, I get:
A1B1A1B2A2...
That's one full frame on A, a field on B, a field on A, a field on B.
Now if A and B are two parts of the signal, A is svideo and B is P+Pr, I can find Y,U, in svideo rez, and V in component rez.
The final result is frame 1 in svideo rez plus a field in component rez, then a field of frame 2 in svideo rez plus component rez.
This doesn't work after all :( At best I get a full frame in svideo rez plus half the lines, in Pr only, in a better rez.
If the signal was 15fps or slower I could get Y,V in full rez and U in svideo rez. But there's an idea, if it's a recording you can always play in slow motion, then it would really work :)
Or you are recording some Anime.

jmac698
10th March 2006, 15:47
Now just to confuse you :) I can do some kind of "overclocking", what I meant in my post before, is that the ADC in the chip can switch so quickly between two signals it can record both at the same time, at full speed. This has to be a feature of the chip, I don't think you could do it in software because the timing is so critical. Chips do this internally because they can save on transistors, and not every chip does it that way.
My chip does that on purpose in component mode. This mode has to be supported by the driver, and I don't know if all the right wires are even connected inside.