Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

jevois-daemon won't work with either webcam or JeVois camera

0 votes

I was able to get JeVois built in VirtualBox on a fresh Ubuntu 16.10 install using the jevois-easy-1.0b.tbz bundle. However, jevois-daemon won't work with my integrated webcam. I've verified that the webcam works by running guvcview, but jevois-daemon bombs out with the following messages:

INF Engine::Engine: Loaded 40 vision processing modes.
ERR Engine::onParamChange: Cannot set cpu max frequency -- IGNORED
ERR Engine::onParamChange: Cannot set cpu frequency governor mode -- IGNORED
INF Engine::onParamChange: Using [stdio] hardware (4-pin connector) serial port
INF Engine::onParamChange: No USB serial port used
INF Engine::postInit: Starting camera device /dev/video0
ERR Engine::postInit: Could not access VFE turbo parameter -- Ignored
INF Camera::Camera: [9] V4L2 camera /dev/video0 card VirtualBox Webcam - Integrated  bus usb-0000:00:06.0-2
INFO Engine::postInit: Using display for video output
init done
INF Engine::setFormatInternal: OUT: YUVY 640x300 @ 60fps CAM: YUYV 320x240 @ 50fps MOD: JeVois:DemoSaliency
terminate called after throwing an instance of 'std::runtime_error'
  what():  FTL Camera::setFormat: Camera did not accept the requested video format as specified
Aborted (core dumped)

The same thing happens with the JeVois camera. It displays the saliency demo just fine in guvcview, but gives the same errors as above. Any idea what might be causing this?

asked Apr 1 in Programmer Questions by sgranade (120 points)

1 Answer

0 votes

looking at the messages, jevois-daemon is requesting YUYV 320x240 @ 50fps from the camera, and the camera does not accept that format. For the JeVois camera, indeed this format is not a valid output format given the default videomappings.cfg. Please see this thread for more explanations:

http://jevois.org/qa/index.php?qa=155

Now, for your built-in camera, maybe try to have a look at what it can support, you can do that either with

lsusb -vv

and look for the various resolutions and modes under your camera and under "Videostreaming interface descriptor", or

guvcview -w1

which will list all the pixel formats and video resolutions supported by your camera. Remember (as in thread 155 mentioned above) that you then want to select a videomapping in jevois-daemon that uses one of your camera's supported modes as its input (camera) mode.

answered Apr 3 by JeVois (13,610 points)
Aha. I've gotten my webcam's supported resolutions. How do I adjust the supported video mappings for jevois? None of the current video mappings match what my webcam supports.
The module that accepts the most video modes is Convert. It just converts from any supported camera format to any supported USB format. It behaves like a "dumb" camera but at least you can test whether you can see video from your camera that way.

Edit the file ~/jevois/Config/videomappings.cfg. In there, read the preamble and check out the list of supported camera modes and USB modes. Then add an entry like that:

YUYV 320 240 30.0 RGB565 320 240 30.0 JeVois Convert

the first 4 entries are the output (USB) mode, the next 4 are the camera mode. Convert cannot resize images so make sure USB and camera resolutions match.

Maybe delete all other entries in the file to make sure you don't end up with duplicate USB modes (make a backup of the file somewhere, or you can get it back from github, in jevois/Config/videomappings.cfg)

Then run jevois-daemon
One thing I'm confused by: the same thing happens when I use the JeVois camera with the daemon: it tries to set the format to

INF Engine::setFormatInternal: OUT: YUYV 640x300 @ 60fps CAM: YUYV 320x240 @ 60fps MOD: JeVois:DemoSaliency
terminate called after throwing an instance of 'std::runtime_error'
  what():  FTL Camera::setFormat: Camera did not accept the requested video format as specified

guvcview -w1 doesn't list any YUYV or other JeVois-supported formats other than MJPG. It's not clear to me why the JeVois camera doesn't work with the JeVois software in this instance.
A follow-up: I get a different behavior if I attach the JeVois camera to the virtual machine through VirtualBox's "Devices > USB" menu rather than "Devices > Webcam". If I attach it as a raw USB device, then the YUYV and other supported pixel formats show up.

However, when I run jevois-daemon, it opens a video window that displays nothing. At the command line, none of the commands like "help" or "listmappings" do anything. When I ^C out of the program, I get a memory reference error.
interesting, so it looks like virtualbox was only exposing MJPG before. Now that this is fixed, remember (as in thread 155 above) that you would normally either

- use the jevois camera and then on your host you only use guvcview, not jevois-daemon (because jevois-daemon is already running inside the jevois camera)

- use another camera and then run jevois-daemon on your host

So now that you have the raw USB, I would recommend:

- try your other camera with guvcview. Does it work and can you switch to different resolutions, etc as supported by your camera?

- then try the jevois camera with guvcview, start guvcview as

guvcview -ao none -f YUYV -x 640x360

and go from there (play with resolutions, etc).

- then, if you want, try your other camera with jevois-daemon running on host, in this case you can use

jevois-daemon --videomapping=X

where X would be a mapping number (as returned by listmappings).

jevois-daemon hanging like that suggests that the video frames are not flowing. So better first confirm that you can grab video, by using guvcview.
I must be missing something. I edited ~/jevois/Config/videomappings.cfg and left only the one line with a custom Convert but when I started /usr/local/bin/jevois-daemon it tried to run the demosaliency default as if I had done nothing to the videomappings.cfg file.  Even if I delete videomappings.cfg I get the same behaviour. Is there another one being used? I used jevois-easy-install and as far as I know just used the defaults.

OK, I get it now. It's /jevois/config/videomappings.cfg that you have to edit.
...