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.
| [reply] |
Zentara,
thanks for the reply. I'll investigate and report back the results.
CptSkripto
| [reply] |
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.
| [reply] |