Shop OBEX P1 Docs P2 Docs Learn Events
stupid video capture — Parallax Forums

stupid video capture

PerryPerry Posts: 253
edited 2012-05-04 18:16 in Propeller 1
Update June 13 2011

new code called PropPixelator

amazing simple hardware changes

This version uses the keyboard as operator interface

'
' input controls : function:
'
' key 0.1.2.3.4.5.6.7.8.9 ..... select video to play/record
'
' key S/s .................... SHOW displays real time video and selected file
'
' key P/p .................... PLAY
'
' key R/r .................... RECORD
'
' key D/d .................... DUMP live image to BMP file
'
' key SpaceBar .............. Pause/Go

Cogs used

0 the main one
1 keyboard input
2 Grey TV display
3 audio in/out ADC/DAC combined
4 video in ADC
5 fsrw/safe_spi
6
7

There are two example video files on post #62 that demonstrate the capabilities of this program. Also new schematic for interface hardware.


Update November 29 2010

Amazing Video


a simple SD video recorder/player

Now contains large video clip of the "Flintstones"

You need to put the files PLEASE.POP and VIDEO0.POP on your SD card.

PLEASE.POP plays when you change modes.
video0.pop will be played if you press the play button or if you set the main program 8bc_video.spin to startup in play mode.


control is via an infra red remote

SHOW display real time

PLAY play recorded video VIDEO0.POP

RECORD increase name of VIDEO?.POP and records some video

Still a work in progress

Cogs used

infra_red input
tv display
audio in adc
audio out duty DAC
video in adc and 15750 khz audio buffer fill
fsrw/safe_spi


sometimes have to compile in play mode to test.


Video is now much better than original, have to right shift 2 bits so there is not too many shades for standard propeller video circuit.

Old Stuff Below:

Here is another simple toy that uses the sigma-delta circuit

it captures NTSC video and puts it out on the TV



no sync separator required. Don't be afraid to try this out, I have fly wires all over my proto board and it still functions passably (sync separator does not do much better)

the A/D converter is running at 6bits , 1.25 Mhz you get 64 dots by 96 lines, the sync detector only sees vertical sync and then the capture proceeds on a timeing basis only.

the image you see below shows an example capture
a graph of the horizontal video line and some a/d values for one of the lines
finally the number of microseconds for the spin code to display the captured image

Perry

P.S. Just tried changing the code to baseband video ( wanted to capture an image for forum) and it only seems to work on VHF tv ???
expect an update (or may be problem with my proto board)

Baseband is OK, my prop board video out had a small capacitor for VHF TV use

Post Edited (Perry) : 11/24/2007 3:52:00 AM GMT
640 x 480 - 32K
514 x 394 - 9K
809 x 606 - 10K
640 x 480 - 72K
«13

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-10-30 07:24
    Interesting experiments...
    When I get the timings right, you
    (a) filter somewhat below 1 MHz with the hardware (220k * 5 to 10 pF Propeller input)
    (b) you sample 72 pixels/line at around 1 us in the assembly part
    (c) you copy those "mega pixels" with an extremely slow loop onto the Prop video.

    As the last loop will use a mixture of nearly 100 real time frames this should look funny..
    I don't know, I did not check it..

    What is the distribution of the luma values you sample within 1us? As you see 6 bit resolution you can estimate the quality of the filtering from it...
    As you will have only 2 grayscale values using GRAHICS you can easily increase the sampling to have 160 pixels per line...

    Things will look much clearer (again: I do not know how they look now smile.gif ), when you prebuffer a complete frame, not just a line...
  • APStech-AttilaAPStech-Attila Posts: 38
    edited 2007-10-30 07:43
    Now imagine this running on Prop2! [noparse]:)[/noparse] [noparse]:)[/noparse]

    ·· Attila
  • bambinobambino Posts: 789
    edited 2007-10-30 07:49
    deSilva,
    Do you think this could lead to some sort of short range RF application due to the Propeller being able to Broadcast signals?
  • PerryPerry Posts: 253
    edited 2007-10-30 16:57
    Still trying to grab some video or images for the forum, xawtv is not co-operating

    mean while a short explanation:

    the spin code passes base addres of byte array for image to the frame grabber, that uses code stolen from Terry Hitt's OSD and sigmal-delta
    it simply copies every thing it sees into the byte array with a little bit of code to try to fressen up the image

    you start with 6 bits of A/D , I then do some arithmetic to try to get rid of the offset from the sync pullses and SHR once to dump noise

    you end up with about 4 or 5bits of gray.

    the grabber is running full speed my attempts with modifiications to "Prop" assembly to do only one grab are still primitave hacks

    the spin code then continously dumps the the recievied data to the display , but this takes over 1.2 seconds.

    the code does not even do double buffering

    pictures are OK at low levels

    Can hardly wait for the "Prop II" , lack of RAM memory is often a problem for my "stupid" ideas

    Perryt

    Post Edited (Perry) : 10/31/2007 2:28:27 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-30 19:34
    Perry said...
    Can hardly wait for the "Prop II" , lack of RAM memory is often a problem for my "stupid" ideas
    No, there is enough memory in the Prop I. This is why I made my improvement suggestions. When you get rid of SPIN and GRAPHICs you can realize a sweet frame grabber.

    P.S.: What you have described is very clear from the code...
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-30 19:38
    bambino said...
    deSilva,
    Do you think this could lead to some sort of short range RF application due to the Propeller being able to Broadcast signals?
    What do you want to transmit?
    In fact you can transmit whatever you want. Just modulate any frequency you like from 100kHz to 100 MHz (even above) and add an antenna of appropriate length to the output pin....
  • PerryPerry Posts: 253
    edited 2007-10-31 00:40
    I just managed to capture some video from channel 2 with xawtv, it's to large and noisy for publishing but I thought some notes about getting the circuit running would help.

    I changed the init colors back to "$2B060C02" from "$04030201", seems xawtv needs some color to work properly.

    also it would not start properly until I put a volt meter at the junction of the 1Meg ohm resistors ( it reads 1.567 volts)
    that point needs some analysis to decide on better values to do the sync separation

    I even cut the power lead to the LM1881 sync separator, thinking it's signal was leaking into the other.circuit


    Perry

    P.S
    just replaced the lower 1M ohm resistor with 680k + 3 * 100K = 980 , voltage now reads 1.549
    sync capture starts right away every time, I think the ratio is important, any one have suggestions on standard resistors values for this application.

    Post Edited (Perry) : 10/31/2007 2:23:55 AM GMT
  • bambinobambino Posts: 789
    edited 2007-10-31 10:05
    Thank you, deSilva.
    I knew the prop could generate such signals, just had not seen where it could recieve them.
    Simple RC commands would be great, but data from remote sensors would be nice as well.
  • rjo_rjo_ Posts: 1,825
    edited 2007-10-31 14:19
    Perry,

    Thanks for posting this. I actually thought that this was impossible... for some reason, which I don't remember.

    This is a stupid question... but since I just barely understand what you are doing here, please allow it:

    Can you increase the bit depth by assuming that you have a static image coming in on the video and sampling successive frames as though they are not changing?

    Rich
  • BeanBean Posts: 8,129
    edited 2007-10-31 14:55
    Perry said...
    the spin code passes base addres of byte array for image to the frame grabber, that uses code stolen from Terry Hitt's OSD and sigmal-delta
    Perry, not "stolen", "borrowed" [noparse];)[/noparse]

    Really a cool idea. Are you hacking one of HC-OSD modules to do this ?

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My goal is to live forever...Or die trying.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • bambinobambino Posts: 789
    edited 2007-10-31 16:04
    rjo,

    You may have, like me, seen the same thread. Some one asked if the Prop could pick up TV signals as well as send them. And the answer was no due to the speed of the signal. I guess I kind of assumed that any signal could not be picked up. This is a great study Perry. That TV wrist watch is just around the corner!!
  • rjo_rjo_ Posts: 1,825
    edited 2007-10-31 16:21
    It's like closing the wrong switch[noparse]:)[/noparse] it just happens... idonowhy.

    Once people figure out what is possible... then they find the most interesting ways of doing it.

    There should be more people like Perry and Bean.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-10-31 17:24
    Bean (Hitt Consulting) said...
    Perry, not "stolen", "borrowed" [noparse];)[/noparse]

    you'll be wanting it back then [noparse]:)[/noparse]
  • PerryPerry Posts: 253
    edited 2007-10-31 22:10
    This project was mainly a test bed demonstrate two things

    the signal-delta is no big deal. (if anyone at Parallax saw my protoboard layout they would be rolling their eyes in disgust)
    I hope it breaks forum readers from any reticence about trying out the sigmal/delta circuit

    and secondly the propeller could capture video on it's own

    now comes the long refinement stage to actually make it useful, reliable and reproduceable

    and also what uses could it have?

    it was mainly designed to give imageing to a Propellor Sumobot, I have slowly been working on.
    I still have 8 unused pins on it. maybe even stereo images.(B/W CMOS cameras are really cheap)

    for distance imaging on a robot you don't need 128 lines of video just 16 or 32 from could be plenty
    you could sum pairs of lines to gain bits of grayscale

    Perry

    P.S.
    Sorry Bean I could not afford your OSD. The local "Community Futures" bought me a "Robot Competition Kit" and a pack of protoboards when i proposed giveing an "Intoduction to Robotics" to the local high school. They are still dragging their feet on actually scheduling the event
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-01 01:11
    the lead diagram didn't display correctly until I pasted it to the Prop Tool.
    781 x 295 - 4K
  • PerryPerry Posts: 253
    edited 2007-11-01 01:34
    Sorry about that Fred

    I cut it from the prop tool and then spent spent quite some time getting it to display well with Firefox,
    now I see I.E. does not do it so good. ( isn't that what the "CODE" example button is for?

    What browser do you use ?

    Perry
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-11-01 01:42
    IE, for no better reason than it came on the computer. I've firefox installed but never bothered...
  • PerryPerry Posts: 253
    edited 2007-11-20 03:08
    I had an epiphany last night after many attempts to adjust the voltage for the sync separator just right I recalled that the A/D converter was actively keeping the voltage on its circuit at 1/2 Vdd, this is exactly what was needed to keep the sync separator at the optimum voltage, after trying out a few options I came up with a new circuit that is DC coupled except for the injection of the video into the sync separator point.

    It know seems to work very reliably, can even watch hockey games, eh!

    New schematic and code has been put at the top of this thread.

    The use of infra red receiver allows one to adjust parameters in the code on the fly, subtracting an offset value to dump of the sync pulse from the video A/D and shifting the number of bits displayed << or >> to dump noisy bits.

    I'd bet dollars to donuts you could build this circuit on a demo board, would like to see reports of any one try this out.

    Perry
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-11-20 06:09
    I've been wondering for a while now if the propeller was capable of something like this. Now just send the output to a graphical LCD, and you have a little portable television!
  • GavinGavin Posts: 134
    edited 2007-11-20 10:44
    Cool stuff Perry.

    Going to make robots interesting.
    Doing this on Prop 2 should be a breeze.

    Tried a few times to get my hands on Omnivision's OV6920 1/18" cmos image sensor.
    Could even generate the OV6920 required clock from the prop, making it easy to lock the scan rate.
    Guess I have to hang around hospitals and wait for them to throw them away.
    http://www.ovt.com/data/newsreleases/english/OV6920_medical_sensor_Avantis_FINAL.pdf
    Think we can get Parallax to make a micro camera PCB?

    Graham, flying robots with collision avoidance?
    New prop data sheet does not have chip weights[noparse]:([/noparse]
    LQFP 0.36 grams on my new 0.01gm scale, 6.28gm for DIP40, don't have any QFNs to weight.

    Gavin
    ·
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-11-21 11:42
    I've got a couple of the OV6920 arays, they really are silly small, not used them yet, this could definately be one way to get them working at very low overhead.

    Graham
  • PerryPerry Posts: 253
    edited 2007-11-21 15:06
    I have been trying out the Hi color raster demo on the Hydra forum with the "Stupid video capture" can actually get a couple more shades of gray out of that. Just copying the out put from the adc converter into it video buffer. can now watch display in real time with close to 3bits of gray scale full screen

    I have one B/W ,one color camera , and satellite receiver as inputs

    going to try inter leave two videos with this driver


    Perry
  • BaggersBaggers Posts: 3,019
    edited 2007-11-21 15:52
    that's excellent Perry [noparse]:D[/noparse] keep it up, imagine how good it'll be on Prop2 [noparse]:D[/noparse]
  • PerryPerry Posts: 253
    edited 2008-06-13 01:03
    Updated code showing framework for B/W video record and playback to SD card.

    This one is using a sync separator (LM188x)

    filename for recording is hard coded

    VIDEO1.zip is short clip

    Perry

    Post Edited (Perry) : 6/13/2008 1:10:01 AM GMT
  • rjo_rjo_ Posts: 1,825
    edited 2008-06-13 01:48
    Perry,

    Back in 2007 I accepted your challenge and tried to breadboard your circuit... and it worked except... almost.

    I sense that you are on the front of the curve and encourage you to think commercial...

    I really love playing with hardware... but I rarely get anything to work. I strongly encourage you to keep up the good work and to offer some products along the way[noparse]:D[/noparse]

    Rich
  • BTXBTX Posts: 674
    edited 2008-06-13 02:28
    Hi Perry.
    What is that ".pop" file in video.zip ??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • PerryPerry Posts: 253
    edited 2008-06-13 11:27
    video1.pop is a video clip produced by the record_video program.

    put it on your SD card and use play_video to see a short clip , should work on systems with video on pins 12 ... and SD cn 0,1,2,3

    Perry
  • VIRANDVIRAND Posts: 656
    edited 2008-06-15 00:16
    rjo said...

    I sense that you are on the front of the curve and encourage you to think commercial...

    This project is very interesting. It reminds me of the "PXL-2000".
    www.google.com/search?hl=en&q=PXL-2000
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-05-09 09:05
    Everybody keeps saying "It'll be gread when the Prop II comes". True but that doesn't seem to be anytime soon (ish) and old gits like me havent got our feeble minds, fat fingers and duff eyesight round the Prop I yet! Keep on with the experiments, it is easy to do things with better and better kit. There comes a time when the obvious answer is to buy the right equipment in the first place. That wasn,t the question though.
  • RaymanRayman Posts: 14,833
    edited 2009-06-15 00:34
    I've been toying around with putting the video directly on an LCD screen with a little success finally...

    But, the sync circuit wasn't always working for me for reasons I don't quite get...· I'm generating video with the Prop and trying to display it on the LCD.· I think I have it working but I had to change the circuit to this:

    Had to break out a scope to see what was going on...· I'm not sure I'm completely happy with this, but it more or less works now...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
    607 x 222 - 5K
Sign In or Register to comment.