dc78
Posts: 1
Joined: Wed Nov 21, 2012 5:13 pm

Re: Webcam stream

Wed Nov 21, 2012 5:18 pm

Also work with: Logitech, Inc. HD Webcam C510

Code: Select all

[email protected] ~/mjpg-streamer $ lsusb 
Bus 001 Device 005: ID 046d:081d Logitech, Inc. HD Webcam C510

poofytoo
Posts: 1
Joined: Fri Nov 23, 2012 7:16 am

Re: Webcam stream

Fri Nov 23, 2012 7:20 am

This is great, thanks for pointing it out / thanks bobtech!

For some reason, my raspberry pi crashes after someone has been viewing the stream for too long. the log doesn't show anything. does anyone know whats going on/how to fix this?

ToddFerrante
Posts: 19
Joined: Sun Sep 30, 2012 8:00 pm

Re: Webcam stream

Sun Dec 02, 2012 8:49 pm

I was successful getting my Logitech c270 to stream using mjpg-streamer and the instructions in this thread: http://www.raspberrypi.org/phpBB3/viewt ... 38&t=19661
I am able to view the video stream on my desktop, my laptop, and my Nexus 7 using firefox (desktop and laptop) and chrome (Nexus 7). But, when I try to watch the stream with another Raspberry Pi (using chromium), I get a single frame and the stream freezes. Anyone have any ideas how I can get the video to stream properly on a Raspberry Pi?
Todd F.

Major Stryker
Posts: 1
Joined: Sat Aug 18, 2012 11:21 pm

Re: Webcam stream

Wed Dec 12, 2012 8:17 am

Following these instructions i managed to get my QuickCam 9000 working so i now can see the live stream.
I had been trying for a long while with my Quickcam 4000 and it would just give me the Failed to start error but as soon as i switched to the Quickcam 9000 it worked great.

Now going to spend some time tweaking it and finding a use for it :).

Thanks for the all the info posted on here i am slowly learning linux and the Pi :).

dreamer
Posts: 1
Joined: Wed Dec 26, 2012 9:37 pm

Re: Webcam stream

Wed Dec 26, 2012 9:40 pm

Hmmm, with my webcam (046d:08ce Logitech, Inc. QuickCam Pro 5000) I can succesfully start the server, but the webpage just says:

Code: Select all

404: Not Found!
Could not open file
Any ideas?

Ziai
Posts: 2
Joined: Sun Dec 30, 2012 5:57 am

Re: Webcam stream

Sun Dec 30, 2012 6:03 am

I need help making my stream to be reachable from outside the LAN.
I got the stream working.. perfectly..
I got it tested on with my local ip..
but how to make it work for public ip?
I have an account on no-ip.com which attaches domain name to what ever IP you currently have, and I have my router firewall rule set up. I can do other things using same methods (for instance, reach MyBookLive bittorrent server from elsewhere or simply ssh into it..., so I assume there is nothing wrong with router's firewall rule and actual domain I am using..
So that leaves me with unknown. :>
How to make it work as in example "http://raspberrypi:8080/ ........." ?

chirag
Posts: 18
Joined: Fri Dec 14, 2012 1:04 pm

Re: Webcam stream

Sat Jan 26, 2013 12:47 pm

i followed the steps im just getting an green screen ...you have any idea why is that happening...?? :cry:

Ziai
Posts: 2
Joined: Sun Dec 30, 2012 5:57 am

Re: Webcam stream

Sat Jan 26, 2013 6:45 pm

chirag wrote:i followed the steps im just getting an green screen ...you have any idea why is that happening...?? :cry:
Same here.

wibble82
Posts: 66
Joined: Sun Jan 27, 2013 5:06 pm
Contact: Website

Re: Webcam stream

Sun Jan 27, 2013 5:08 pm

Hi

I just posted this tutorial on getting a basic web cam working - might be helpful:

http://robotblogging.blogspot.co.uk/201 ... on-10.html

Then again, it might just repeat the same things as below and have the same issues.

Will be following it up with reading the stream in code and rendering it using the gpu.

-Chris

mesmariusz
Posts: 57
Joined: Fri Feb 15, 2013 6:07 am

Re: Webcam stream

Fri Apr 12, 2013 3:12 pm

Hmm...

I have done:

[email protected]:/home/pi/mjpg-streamer# ./mjpg-streamer.sh start
started
[email protected]:/home/pi/mjpg-streamer#

But when I entered on correct url and port I got in browser:

404: Not Found!
Could not open file

Could someone help me?

[email protected]:/home/pi/mjpg-streamer# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1e4e:0102
[email protected]:/home/pi/mjpg-streamer#

[email protected]:/home/pi/mjpg-streamer# ls /dev/video0 /dev/video0
[email protected]:/home/pi/mjpg-streamer#

theunknown
Posts: 15
Joined: Mon May 19, 2014 8:19 pm

Re: Webcam stream

Mon May 19, 2014 8:21 pm

Hello

I am too having the same issue as the user above. When trying to access the cam page locally I received "This page can't be displayed. I am sure I am using the correct IP address and Port

http://MyLocalRaspberryPiIP:PortIChanged/?action=stream

Could someone help me with this?

Thanks

sadiqodho
Posts: 3
Joined: Sat Jul 26, 2014 5:46 am
Location: Pakistan
Contact: Website

Re: Webcam stream

Sun Jul 27, 2014 9:31 am

I have faced problem when i want to ./mjpg-streamer.sh start
faild to start :oops:

I am using
Bus 001 Device 006: ID 041e:4034 Creative Technology, Ltd Webcam Instant

I have referred this tutorial
http://www.bobtech.ro/tutoriale/raspber ... spberry-pi

mjgp-streamer.log

Code: Select all

MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 4
 i: Format............: YUV
 i: JPEG Quality......: 80
i: The format asked unavailable, so the width 352 height 288 
The input device does not supports YUV mode
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 4
 i: Format............: MJPEG
i: The format asked unavailable, so the width 352 height 288 
The inpout device does not supports MJPEG mode
You may also try the YUV mode (-yuv option), but it requires a much more CPU power
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
 i: Frames Per Second.: 5
 i: Format............: MJPEG
i: The format asked unavailable, so the width 176 height 144 
The inpout device does not supports MJPEG mode
You may also try the YUV mode (-yuv option), but it requires a much more CPU power
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed
MJPG Streamer Version: svn rev: 3:160M
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 320 x 240
 i: Frames Per Second.: 5
 i: Format............: MJPEG
i: The format asked unavailable, so the width 176 height 144 
The inpout device does not supports MJPEG mode
You may also try the YUV mode (-yuv option), but it requires a much more CPU power
 Init v4L2 failed !! exit fatal 
 i: init_VideoIn failed

mjpg-streamer.sh

Code: Select all

#!/bin/bash

VIDEO_DEV="/dev/video0"
FRAME_RATE="4"
RESOLUTION="640x480"
PORT="8080"
YUV="true"

MJPG_STREAMER_DIR="$(dirname $0)"
MJPG_STREAMER_BIN="mjpg_streamer"
LOG_FILE="${MJPG_STREAMER_DIR}/mjpg-streamer.log"
RUNNING_CHECK_INTERVAL="2" # how often to check to make sure the server is running (in seconds)
HANGING_CHECK_INTERVAL="3" # how often to check to make sure the server is not hanging (in seconds)

function running() {
    if ps aux | grep ${MJPG_STREAMER_BIN} | grep ${VIDEO_DEV} >/dev/null 2>&1; then
        return 0

    else
        return 1

    fi
}

function start() {
    if running; then
        echo "already started"
        return 1
    fi

    export LD_LIBRARY_PATH="${MJPG_STREAMER_DIR}:."
    
    INPUT_OPTIONS="-r ${RESOLUTION} -d ${VIDEO_DEV} -f ${FRAME_RATE}"
    if [ "${YUV}" == "true" ]; then
        INPUT_OPTIONS+=" -y"
    fi
    
    OUTPUT_OPTIONS="-p ${PORT} -w www"
    
    ${MJPG_STREAMER_DIR}/${MJPG_STREAMER_BIN} -i "input_uvc.so ${INPUT_OPTIONS}" -o "output_http.so ${OUTPUT_OPTIONS}" >> ${LOG_FILE} 2>&1 &

    sleep 1

    if running; then
        if [ "$1" != "nocheck" ]; then
            check_running & > /dev/null 2>&1 # start the running checking task
            check_hanging & > /dev/null 2>&1 # start the hanging checking task
        fi

        echo "started"
        return 0

    else
        echo "failed to start"
        return 1

    fi
}

function stop() {
    if ! running; then
        echo "not running"
        return 1
    fi

    own_pid=$$

    if [ "$1" != "nocheck" ]; then
        # stop the script running check task
        ps aux | grep $0 | grep start | tr -s ' ' | cut -d ' ' -f 2 | grep -v ${own_pid} | xargs -r kill
        sleep 0.5
    fi

    # stop the server
    ps aux | grep ${MJPG_STREAMER_BIN} | grep ${VIDEO_DEV} | tr -s ' ' | cut -d ' ' -f 2 | grep -v ${own_pid} | xargs -r kill

    echo "stopped"
    return 0
}

function check_running() {
    echo "starting running check task" >> ${LOG_FILE}

    while true; do
        sleep ${RUNNING_CHECK_INTERVAL}

        if ! running; then
            echo "server stopped, starting" >> ${LOG_FILE}
            start nocheck
        fi
    done
}

function check_hanging() {
    echo "starting hanging check task" >> ${LOG_FILE}

    while true; do
        sleep ${HANGING_CHECK_INTERVAL}

        # treat the "error grabbing frames" case
        if tail -n2 ${LOG_FILE} | grep -i "error grabbing frames" > /dev/null; then
            echo "server is hanging, killing" >> ${LOG_FILE}
            stop nocheck
        fi
    done
}

function help() {
    echo "Usage: $0 [start|stop|restart|status]"
    return 0
}

if [ "$1" == "start" ]; then
    start && exit 0 || exit -1

elif [ "$1" == "stop" ]; then
    stop && exit 0 || exit -1

elif [ "$1" == "restart" ]; then
    stop && sleep 1
    start && exit 0 || exit -1

elif [ "$1" == "status" ]; then
    if running; then
        echo "running"
        exit 0

    else
        echo "stopped"
        exit 1

    fi

else
    help

fi

kindly guide me i have tried a lot.

SKAL
Posts: 1
Joined: Tue Apr 21, 2015 7:51 am

Re: Webcam stream

Wed Apr 22, 2015 1:24 pm

Hi, since I have the same problem, did you solved somehow?

Tnx

vsayanam
Posts: 12
Joined: Tue Nov 06, 2012 11:10 am

Re: Webcam stream

Sun Dec 04, 2016 6:50 am

This seems to be an old issue. However the problem of "Init_VideoIn failed" was solved when "sudo service motion stop" was executed. There was some input problem when fswebcam was tried and so I thought some other program was taking control of input.

Return to “Graphics, sound and multimedia”