Thanks for your reply.
I tried calling the setFormat() method of VideoInputFrameGrabber, without any improvement (see the code snippet below)
VideoInputFrameGrabber grabber = new VideoInputFrameGrabber(0);
grabber.setFormat("MJPG");
// grabber.setImageWidth(w);
// grabber.setImageHeight(h);
grabber.start();
I also created a copy of VideoInputFrameGrabber and added the line
myVideoInput.setRequestedMediaSubType(VI_MEDIASUBTYPE_MJPG)
in the start() method, but nothing changed, either using "VI_MEDIASUBTYPE_MJPG" or an other media subtype constant.
I get those logs when I don't set the image dimensions, or when I set it to "correct" resolutions (e.g. 1920*1080 or 1280*720):
***** VIDEOINPUT LIBRARY - 0.2000 - TFW2013 *****
SETUP: Setting up device 0
SETUP: HD USB Camera
SETUP: Couldn't find preview pin using SmartTee
SETUP: Default Format is set to 1600 by 1200
SETUP: trying requested format RGB24 @ 1920 by 1080
SETUP: trying format RGB24 @ 1920 by 1080
SETUP: trying format RGB32 @ 1920 by 1080
SETUP: trying format RGB555 @ 1920 by 1080
SETUP: trying format RGB565 @ 1920 by 1080
SETUP: trying format YUY2 @ 1920 by 1080
SETUP: Capture callback set
SETUP: Device is setup and ready to capture.
The format seems here to be YUY2, which would be consistant with the low frame rate I get (5fps at 1920*1080), but neither a call to setFormat("MJPG") nor a call to setRequestedMediaSubType() change that. With "incorrect" dimensions, I get 30fps and I have the following:
***** VIDEOINPUT LIBRARY - 0.2000 - TFW2013 *****
...
SETUP: trying format RGB565 @ 800 by 800
SETUP: trying format YUY2 @ 800 by 800
SETUP: trying format YVYU @ 800 by 800
SETUP: trying format YUYV @ 800 by 800
SETUP: trying format IYUV @ 800 by 800
SETUP: trying format UYVY @ 800 by 800
SETUP: trying format YV12 @ 800 by 800
SETUP: trying format YVU9 @ 800 by 800
SETUP: trying format Y411 @ 800 by 800
SETUP: trying format Y41P @ 800 by 800
SETUP: trying format Y211 @ 800 by 800
SETUP: trying format AYUV @ 800 by 800
SETUP: trying format Y800 @ 800 by 800
SETUP: trying format Y8 @ 800 by 800
SETUP: trying format GREY @ 800 by 800
SETUP: trying format OTHER @ 800 by 800
SETUP: couldn't find requested size - searching for closest matching size
SETUP: closest supported size is OTHER @ 800 600
SETUP: Capture callback set
SETUP: Device is setup and ready to capture.
A also tried calling grabber.setVideoCodec(avcodec.AV_CODEC_ID_MJPEG) instead of setFormat(), but it's still does nothing, and I'm a bit confused about the differences between setFormat(), setVideoCodec(), and setPixelFormat().