Troubles with videoGrabber

Hi,

I’ve recently bought a new camcorder (Canon LEGRIA HV40) as video capturing device for my application (earlier, I used a webcam, but it was not satisfying about capture performances, for instance: the frame rate extremely suffered low light condition). I plug it in (using a Firewire cable), switched the capture resolution and…nothing works more! And I had no errors in my console log. I tried to capture with some other programs (such as Windows Movie Maker), and it works perfectly. Please, help me understanding the way to solve my problems. Thank you very much,

In order to help you to help me :slight_smile: here is what OF puts into the console:

  
***** VIDEOINPUT LIBRARY - 0.1995 - TFW07 *****  
  
SETUP: Setting up device 0  
SETUP: Microsoft DV Camera and VCR  
SETUP: Couldn't find preview pin using SmartTee  
SETUP: Default Format is set to 720 by 576  
SETUP: trying format RGB24 @ 720 by 576  
SETUP: trying format RGB32 @ 720 by 576  
SETUP: trying format RGB555 @ 720 by 576  
SETUP: trying format RGB565 @ 720 by 576  
SETUP: trying format YUY2 @ 720 by 576  
SETUP: trying format YVYU @ 720 by 576  
SETUP: trying format YUYV @ 720 by 576  
SETUP: trying format IYUV @ 720 by 576  
SETUP: trying format UYVY @ 720 by 576  
SETUP: trying format YV12 @ 720 by 576  
SETUP: trying format YVU9 @ 720 by 576  
SETUP: trying format Y411 @ 720 by 576  
SETUP: trying format Y41P @ 720 by 576  
SETUP: trying format Y211 @ 720 by 576  
SETUP: trying format AYUV @ 720 by 576  
SETUP: trying format Y800 @ 720 by 576  
SETUP: trying format Y8 @ 720 by 576  
SETUP: trying format GREY @ 720 by 576  
SETUP: couldn't find requested size - searching for closest matching size  
SETUP: closest supported size is OTHER @ 720 576  
SETUP: Capture callback set  
SETUP: Device is setup and ready to capture.  
  
trying to set codec type to (Sorenson Video 3)  

while in my application window videoGrabber doesn’t draw anything!

Sorry guys,

videoGrabber didn’t draw anything because I forgot to set videoGrabber.initGrabber(720, 576, true). :oops:

Anyway, there is also a problem with encoding. I used the MemoryMovieMaker. OF log says:

  
error in AddMediaSample  
error in AddMediaSample  
error in AddMediaSample  
...  

for every grabbed and encoded frame. Could it be due to something like erroneous codec settings?

Another clue: if I print the OSErr value returned by AddMediaSample, I get: -2014. Which, as I see, means that something goes wrong with the specified frame duration. And that is strange: since I set application cycle to 24 fps, I set the frame duration to 25, expressed in a 600 units time scale. So what could be the issue? Please, help me!

Ok, think that something goes wrong with the conversion - maybe int to float casting - now this works.