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

stupid video capture

2

Comments

  • Chris MicroChris Micro Posts: 160
    edited 2009-06-15 05:50
    Hi Rayman,

    in this thread I tried to minimize the number of components for a video caputre.
    The sync separation level can be adjusted with a poti. It was possible to trigger reliably on the frame change sync pulse, but to detect the line syncs reliably was not so well working.
    Some people statet that a LM1881 would be necessary for a good sync separator.
    But I developed another diskrete solution some years ago whch works quite stable with my C-MOS camara.
    During my experiments with the propeller sync separation I had the impression that the switching level of the propeller inputs may not be as stable as expected but I'm not so sure. Probably other people can contribute some information about the input characteristics of the digital propeller pins.

    chris
  • RaymanRayman Posts: 14,833
    edited 2009-06-15 09:18
    Chris: Your circuit looks AC coupled, which I think is required for general purpose use. I think some kind of trim pot, like you have, is going to be required to bias right above threshold... I'll try out your circuit if I get a chance.

    But, I'm really just doing a proof of principle (AKA having fun!) right now and mine works well enough, although it only works with Prop generated video (and isn't entirely stable)...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-15 15:04
    Rayman,

    The reason your circuit works with the Prop and not other sources is that the Prop's output is DC coupled and ground-referenced. Therefore, fluctuations in amplitude from the Prop will not shift the sync tip level. Most video sources are AC-coupled, which means the signal will vary, centered on its average value. This implies that the higher the amplitude, the lower the sync tips will be. Chris's circuit includes a DC restorer (clamp) ahead of the first stage, which guarantees that the sync tips will be at a fixed level. This is necessary for reliable sync detection and also for consistent analog-to-digital conversion.

    -Phil
  • RaymanRayman Posts: 14,833
    edited 2009-06-15 15:25
    Phil: I think you're right. On the other hand though, I think the only practicle application for this is to allow the easy use of those cheap, tiny video cameras with the Prop... I don't know, and haven't tested, but my guess is that they are also DC coupled...

    PS:· As a side note, I initially presumed (as I think deSilva did) that Perry's code only captured one horizontal line per vertical sync, meaning that it would take several frames to complete an image.· But, that is not the case, it captures and entire frame at a time...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    Post Edited (Rayman) : 6/15/2009 3:32:14 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-15 18:34
    Here's a circuit that will provide a stable sync signal to the Prop:

    attachment.php?attachmentid=61601

    The 75R termination resistor is necessary, since some video sources (including the Prop with the usual D/A resistors) provide an incorrect source impedance. What this means is that from video source to video source, the unterminated P-P voltage can vary from 2V (the correct value) all the way up to 5V. The resistor is there to give a consistent 1V P-P. The pot sets the bias point for the sync tips and needs to be adjusted for the best separation. The setting is dependent upon the Prop's logic threshold, which can vary from part to part. The 220K resistor is there to apply a gentle bias current to the cap to make sure that the signal eventually causes the diode to conduct and clamp the sync tips.

    The output from this circuit should have a low enough impedance that it can also be used as the input to a delta-sigma ADC without further amplification.

    -Phil
    334 x 234 - 1K
  • RaymanRayman Posts: 14,833
    edited 2009-06-15 18:42
    Phil: Looks good. I think it's similar to Chris's circuit. I think it'd be nice to also send that signal the ADC. But, doesn't the diode affect the shape of the video signal?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-15 19:01
    No. All the diode does is clamp the sync tips to a known voltage. As a consequence the entire video signal shifts up or down, but the shape does not change.

    -Phil
  • RaymanRayman Posts: 14,833
    edited 2009-06-16 13:52
    I think there's a slight bug with the first pixel in each row... For some reason, it is out of bounds of the 6-bit resolution. I think maybe the phase tracker isn't being initialized correctly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Chris MicroChris Micro Posts: 160
    edited 2009-06-16 16:12
    Rayman said...
    Phil: Looks good. I think it's similar to Chris's circuit.

    It is the same as my circuit. The value of the parts are varied.

    Rayman, do you trigger only on the frame sync or do you also trigger on each line?
  • RaymanRayman Posts: 14,833
    edited 2009-06-16 16:22
    I'm currently using Perry's code "as is". I believe it triggers of both vertical and horizontal syncs.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • PerryPerry Posts: 253
    edited 2009-06-16 16:43
    Hi Rayman

    Nice to see some activity oon this project.

    The video capture code tries to capture one byte each line before saving the line data to fix this, perhaps two bytes might be better.

    When testing the synchronization circuit, check both mostly white and mostly black screens, simple circuits like these move the sync point slightly because of the video content.

    Perry

    P.S.
    I see your PSM is nearly ready for shipment, Any ideas of price yet?
  • RaymanRayman Posts: 14,833
    edited 2009-06-16 16:49
    Perry: I intend to offer an initial price of $95 (a bit lower at the expo...). That's really the best I can do. If it were mass produced, I imagine it could be a lot less, but I'm working in small volumes. The price will probably increase later...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • wjsteelewjsteele Posts: 697
    edited 2009-12-16 02:22
    Can someone answer a quick question for me... why does the schematic show two diodes in series? What does the second diode do?
  • BTXBTX Posts: 674
    edited 2009-12-16 02:30
    Forces 1.4V in syncro signal, 0.7V by two.

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

    Alberto.
  • wjsteelewjsteele Posts: 697
    edited 2009-12-16 15:51
    Ah, duh, that makes sense... thanks!
  • PerryPerry Posts: 253
    edited 2010-10-22 14:02
    I have done a lot of work to this project lately and want to give an update of it's status.

    There is a new set of schematics in the first post, learning from the propeller backpack and input from Phil Pilgrim on this thread.

    The inputs are now AC coupled.

    I have made a significant change to the sync separator. There is a 75 ohm termination on the input circuit, even the LM1881 and it's clones do not work well without this resistor. It now uses two diodes and two extra pins at high and low output to bias the input pin to its best detection point. I rarely have sync problems with this new circuit.

    I plan to publish the new code, but it needs some more cleanup.

    The present code captures and plays 64x192 video with 17500 Hz audio and writes that to a SD card at 30 frames per second in real time.

    I am convinced that is possible to add color to this project, and am pursuing two options for that now.

    Perry
  • PerryPerry Posts: 253
    edited 2010-10-28 10:11
    Update October 28 2010

    Amazing Video Capture

    a simple SD video recorder/player at 30 fps an 17500 Hz 8bit audio

    trying to control is via an infra red remote has been difficult

    Compile 8bc_video.spin as player, recorder or viewer

    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

    0 this one for control
    1 infra_red input
    2 tv display
    3 audio in adc
    4 audio out duty DAC
    5 video in adc and 15750 khz audio buffer fill
    6 fsrw/safe_spi
  • wjsteelewjsteele Posts: 697
    edited 2010-10-28 11:33
    Very cool... can't wait to see it.

    Bill
  • PerryPerry Posts: 253
    edited 2010-10-28 11:51
    The first page on this thread has an update with a video in it.

    Hope people can use RAR extensions.
  • RaymanRayman Posts: 14,833
    edited 2010-10-28 11:59
    Just opened you're RAR file. Was expecting video, but I see it's your new SPIN source code.

    Does the color capture work at all?

    Is the grayscale capture improved now?

    I'd also love to see a photo of the TV screen...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-28 11:59
    I just get a screenful of garbage when I click on your RAR link. Can you post in a more common format?

    -Phil
  • PerryPerry Posts: 253
    edited 2010-10-28 12:25
    Ray
    Color capture is still a dream
    may have to move SD from 0,1,2,3 though

    grayscale ?
    PLAY play recorded video VIDEO0.POP with 8bc_Video.bin in play mode
    any standard video at say 12,13,14 see old man with way too much time on his hands

    sorry Phil
    I use winRAR it works for zip's too

    This is such a finicky program, I just had to update before making changes

    At one time I had the IR control working.
  • RaymanRayman Posts: 14,833
    edited 2010-10-28 16:45
    Ok, I got it! Nice job.

    Using the TV output of a PSB, I just changed TV pins to %001_0000 (toward bottom of program) and SD base pin to 4 (towards top of program).

    I see your using my Propeller video player... Just when I thought that was underappreciated...

    PS: I think you need shave!
  • RaymanRayman Posts: 14,833
    edited 2010-10-28 16:50
    I think the big advantage of this code is that you can use a cheap video camera to interact directly with the propeller for low cost and simplicity.

    The low resolution gray scale is actually perfect for "On Prop" video processing (such as for a robot).
  • PerryPerry Posts: 253
    edited 2010-10-28 17:20
    Ray
    Thanks for watching.
    Found my pesky problem with infraRed decoder (old solder joint came loose)
  • RaymanRayman Posts: 14,833
    edited 2010-10-29 07:16
    Ok, I see your new circuit is it the top post, right?

    It looks like you now have two pins for sync seperation. What's going on there?
  • PerryPerry Posts: 253
    edited 2010-11-03 09:11
    Rayman wrote: »
    Ok, I see your new circuit is it the top post, right?

    It looks like you now have two pins for sync seperation. What's going on there?

    There are actually three pins needed for the sink separation now.
    Two are used to establish a bias voltage for the third as an input.

    an 147K resistor also goes from the input pin to ground.

    The two extra pins used are held at output high and output low.
    A resistor diode resistor are placed between those pins to establish a
    bias voltage just above the voltage of the propellers input threshold.

    Negative pulses from standard video signals is suplied through
    another diode and a capacitor.
  • RaymanRayman Posts: 14,833
    edited 2010-11-03 09:20
    Perry,

    Thanks for the clarification. Can you just use Vdd and Gnd instead of using Prop pins if those 2 are always held in low or high?
  • PerryPerry Posts: 253
    edited 2010-11-03 09:57
    Rayman wrote: »
    Perry,

    Thanks for the clarification. Can you just use Vdd and Gnd instead of using Prop pins if those 2 are always held in low or high?

    No, that's how the former version was done. This new way is taken from the propeller backpack manual, with the addition of the diodes.
  • PerryPerry Posts: 253
    edited 2010-11-29 16:17
    Hi Propeller heads.

    This is a challenge and a bit of a rant!

    I have uploaded my latest copy of what I now call "Amazing Video" to the first post on this thread, it now contains a lengthy clip of the "Flintstones".

    This project does not have any difficult construction problems. The ADC circuits are built with standard 5% resistors, I just bend one lead of a resistor and solder the short end to the sigma delta output and the longer end to the input pin on the proto board. I then solder the input resistor of the ADC circuit to the upper end of the first resistor.

    If you don't like the InfraRed remote control I can easily make a keyboard option.

    The latest version does not use LM1881 but I have added a LED to show that the system in "Show" or "Record" mode (OOP's better update the schematics). If you have no video input it also works a a nice audio recorder.

    OK now the rant.

    I believe that I can do color with not much more circuitry, but no one has called me on this assertion, or asked how it might be done. My proto board is getting shopworn, after changing the audio input to make room for what might be the color inputs it seems there is some short between the audio/video inputs. I just spent two days trying to clean it up, but the sun is down now.( I really can't see those little parts that well without full sunlight. I have cleaned up the the interference pretty well but still have some. Will try again tomorrow.

    Take a look at my proto board now, if there were electronic rats it would make a nice home.

    Thanks for your indulgence.

    Perry
    640 x 480 - 72K
Sign In or Register to comment.