in reply to Re: Video::Capture::V4l tv parameters.
in thread Video::Capture::V4l tv parameters.

Zentara, I apologize for my thickness, could you please elaborate on the "...and for some reason (possibly interlacing) you need to grab 2..."? Does it mean I have to save two frames at a time? TIA CptSkripto
  • Comment on Re^2: Video::Capture::V4l tv parameters.

Replies are listed 'Best First'.
Re^3: Video::Capture::V4l tv parameters.
by zentara (Cardinal) on Sep 05, 2008 at 12:32 UTC
    Look at the grab_one sub, and the for(0..1){...}

    To be honest, I don't fully understand why, but without that, the picture won't sync. I translated the code from a V4l2 code I saw, I think it was in c IIRC. The other thing you will notice, is that the picture comes out BGR, instead of RGB, and it is flipped vertically. Luckily, you can just reverse the data, and it comes out OK, then use Imager to flip it upright.

    The reason why I suspect it needs 2 (and why I guess it's due to interlacing) is the way NTSC video works. It is sent as 2 frames(called odd and even). This was originally done to reduce flicker, as it essentially doubles the refresh rate.

    <guess_hat_on>

    So think what happens when you try to grab a picture. You may be intercepting the video stream at any point in a frame, so you need to latch on to it first, and wait for the sync signal, which resets to the upper left corner, then start the grab on the next frame.

    I'm guessing this won't be a problem with pure digital cameras, but NTSC cameras need it. I see from your grabinfo, that your camera supports pal, ntsc and secam.....those are the basic old analog video formats used in Europe, the US, and S. America.


    I'm not really a human, but I play one on earth Remember How Lucky You Are
      Zentara, thanks for the reply. I'll investigate and report back the results. CptSkripto
        If you can simplify the code, please lets us know. I remember spending an afternoon trying to make it simpler, without success. It should be simpler.

        I'm not really a human, but I play one on earth Remember How Lucky You Are