Can't stream webcam

Discussion in 'Troubleshooting' started by Bela, Mar 21, 2015.

  1. Bela

    Bela Member

    Joined:
    Oct 30, 2013
    Messages:
    32
    Likes Received:
    0
    Hello. I've been using my udoo since the release for general stuff (Web server, Arduino devboard, file hosting) and I've never had a problem configuring everything. Now I've encountered a problem that's driving me crazy.
    I'm using the udoobuntu 1.1 and I'd like to stream my webcam (it's an uvc compatible one, so don't ask). If I use the webcam utility it works flawlessly, but when I try to look for the device name nothing comes out. Later I'll post the output of some commands.
    In the meanwhile could someone link me a decent guide on how to setup a webpage with the steam of the webcam? I need this for a graduation project, and I'd like to not buy the official camera module since I don't have enough money.
    Thanks in advance!
     
  2. Wyatt Clayton

    Wyatt Clayton New Member

    Joined:
    Jul 20, 2015
    Messages:
    1
    Likes Received:
    0
  3. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there Bela,
    you should first of all compile/find a driver for the camera module you're going to use, which is not a trivial issue. We officially support just our camera module. I hope anyway you'll find the answer and share it with the whole community.
    Cheers
     
  4. Mitchell Spryn

    Mitchell Spryn New Member

    Joined:
    Nov 12, 2015
    Messages:
    5
    Likes Received:
    0
    There have been a few threads about problems with streaming USB webcams with the UDOO. If the webcam shows up when you do a lsusb, you can use Mjpeg-Streamer to stream it over the internet (for reference, I'm using this one). Here's a good guide (It's for the pi, but the config's mostly the same.)

    Some gotchas:
    1) Make sure you perform the symlink step described in the guide to get the V4l headers linked correctly.
    2) The video setup is *really* strange on the UDOO. By default, under /dev/, there are a bunch of video ports that aren't actually connected to anything. Most notably, the port /dev/video0 exists, but isn't actually connected to anything. As this is the default input for mjpeg streamer, it will choke it you just try to run start.sh. To determine which port is your USB webcam, you can do the following:

    (unplug webcam)
    ls /dev/ > nocam
    (plug webcam)
    ls /dev/ > cam
    diff cam nocam

    For me, the webcam was /dev/video3. Then, you will need to start mjpg-streamer with a command like:

    ./mjpg_streamer -i "./input_uvc.so -d /dev/video3" -o "./output_http.so -w ./www"

    If you get an error like this:

    ERROR opening V4L interface: Resource temporarily unavailable
    Init v4L2 failed !! exit fatal
    i: init_VideoIn failed

    You probably have the wrong video port.

    3) If you're trying to start and stop the service programatically, mjpg-streamer has a habit of occasionally spawning zombie processes (I.e. if you ctrl+c your program, the webcam service will still be running). This can cause problems if you restart due to resource contention. The solution I found was to read the output of the "ps aux" command, find everything with "mjpg-streamer" in the name, and issue a "kill -9" command.
     

Share This Page