swiveldermon
Posts: 1
Joined: Wed Feb 13, 2013 4:36 am

mjpg_streamer problems

Wed Feb 13, 2013 4:39 am

Hey everyone,
Just got my pi and have been screwing around with some webcam streaming. I'm seeing some strange behavior when it comes to performance of mjpg streamer.

I bought a pre-loaded SD card from Newark:

http://www.newark.com/samsung/raspberry ... dp/96T7436

and got mjpg_streamer up and running quite nicely using this tutorial:

http://www.teslasassistant.com/?p=97

I was getting over 15 fps at 320x240 resolution, and was quite happy with it.

Well I messed with a good thing, and decided to load the "wheezy" version of debian for the pi and reinstall mjpg streamer. It runs...but much slower. I'm lucky if I get 2 fps at 320x240 now.

I'm wondering if anyone has any ideas as to why this is happening. Do you all think that using a netcat approach would work better?

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia

Re: mjpg_streamer problems

Wed Feb 13, 2013 8:43 am

Debian or Raspbian ?
Debian is soft-float only for the Pi so that would affect performance.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

t3itguy
Posts: 3
Joined: Fri Jul 13, 2012 7:16 pm

Re: mjpg_streamer problems

Mon Feb 18, 2013 5:24 am

I'm having the same issues. It doesn't matter if I use hard-float raspbian or arch linux. Either way, just the default settings (640 x 480 @ 5fps) won't hardly load. I had it working fine on Raspbian before, but now it's just giving me all kinds of problems.

User avatar
mrgrey
Posts: 11
Joined: Tue Jul 17, 2012 12:32 pm

Re: mjpg_streamer problems

Mon Feb 18, 2013 11:21 am

I experience mjpeg-streamer startup problems and decreased performance as well. It was working fine ~2 weeks ago. Since then I've updated the following packages:

Code: Select all

Start-Date: 2013-02-03  11:56:35
Commandline: apt-get upgrade
Upgrade: mercurial:armhf (2.2.2-1, 2.2.2-2), mercurial-common:armhf (2.2.2-1, 2.2.2-2), tasksel-data:armhf (3.14, 3.14+nmu1), libcups2:armhf (1.5.3-2.13, 1.5.3-2.14), lsb-base:armhf (4.1+Debian8, 4.1+Debian8+rpi1), tasksel:armhf (3.14, 3.14+nmu1)
End-Date: 2013-02-03  12:00:25

Start-Date: 2013-02-06  12:19:36
Commandline: apt-get upgrade -y
Upgrade: smbclient:armhf (3.6.6-4, 3.6.6-5), psmisc:armhf (22.19-1, 22.19-1+deb7u1), ca-certificates:armhf (20120623, 20130119), libwbclient0:armhf (3.6.6-4, 3.6.6-5), samba-common:armhf (3.6.6-4, 3.6.6-5)
End-Date: 2013-02-06  12:23:50

Start-Date: 2013-02-09  17:25:21
Commandline: apt-get upgrade
Upgrade: perl:armhf (5.14.2-16+rpi1, 5.14.2-17+rpi1), perl-base:armhf (5.14.2-16+rpi1, 5.14.2-17+rpi1), libgnutls26:armhf (2.12.20-2, 2.12.20-4), perl-modules:armhf (5.14.2-16+rpi1, 5.14.2-17+rpi1), libboost-iostreams1.49.0:armhf (1.49.0-3.1, 1.49.0-3.2)
End-Date: 2013-02-09  17:29:22

Start-Date: 2013-02-14  08:09:25
Commandline: apt-get upgrade
Upgrade: libraspberrypi0:armhf (1.20121025-1, 1.20130207-1), libcurl3-gnutls:armhf (7.26.0-1, 7.26.0-1+wheezy1), raspberrypi-bootloader:armhf (1.20121025-1, 1.20130207-1), libraspberrypi-bin:armhf (1.20121025-1, 1.20130207-1), libraspberrypi-dev:armhf (1.20121025-1, 1.20130207-1), libraspberrypi-doc:armhf (1.20121025-1, 1.20130207-1), gdb:armhf (7.4.1-3, 7.4.1+dfsg-0.1), libcurl3:armhf (7.26.0-1, 7.26.0-1+wheezy1), curl:armhf (7.26.0-1, 7.26.0-1+wheezy1), gdbserver:armhf (7.4.1-3, 7.4.1+dfsg-0.1)
End-Date: 2013-02-14  08:13:58
Guess I'll check the changelogs of some of them.. Also, recompiling mjpeg-streamer had no effect; found no errors in any logs and fswebcam --verbose shows a "timeout waiting for frame" now..

regards,

User avatar
mrgrey
Posts: 11
Joined: Tue Jul 17, 2012 12:32 pm

Re: mjpg_streamer problems

Tue Feb 19, 2013 9:31 am

I did downgrade

Code: Select all

libraspberrypi-bin
raspberrypi-bootloader
libraspberrypi0
and mjpeg-streamer is working much better (again).

Downgrade could go like this:

Code: Select all

pi@raspberrypi:~> mkdir /tmp/downgrade/
pi@raspberrypi:~> cd /tmp/downgrade/
pi@raspberrypi:/tmp/downgrade/> wget http://archive.raspberrypi.org/debian/pool/untested/r/raspberrypi-firmware/libraspberrypi-bin_1.20121025-1_armhf.deb
pi@raspberrypi:/tmp/downgrade/> wget http://archive.raspberrypi.org/debian/pool/untested/r/raspberrypi-firmware/raspberrypi-bootloader_1.20121025-1_armhf.deb
pi@raspberrypi:/tmp/downgrade/> wget http://archive.raspberrypi.org/debian/pool/untested/r/raspberrypi-firmware/libraspberrypi0_1.20121025-1_armhf.deb
pi@raspberrypi:/tmp/downgrade/> sudo dpkg -i *.deb
reboot afterwards. You might want to either stop updating or put those packages on hold for now..

lalee
Posts: 6
Joined: Sun Jan 27, 2013 11:23 am

Re: mjpg_streamer problems

Sun Feb 24, 2013 3:07 am

Change your frequency governor if you're overclocking. The "ondemand" governor is completely worthless crap when combined with mjpg-streamer, as mjpg-streamer (when pulling mjpg directly from the camera) doesn't produce enough load to exceed ondemand's threshold to boost the CPU frequency.

If you want to achieve higher fps consistently, use the "performance" governor, and don't look back:

echo 'performance' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

I've been working on web streaming issues for my RPi-based Aquaponics controller for a couple of weeks now, and am now streaming 960x720 at 30fps reliably under the "performance" governor, overclocked at 1GHz.

I also had to dive into the kernel code to fix some shamelessly unacknowledged bugs in the USB (dwc_otg) driver in my private kernel fork, which (unfixed) would occasionally break the video stream after an extended period of time.
»»» If you want or need an immediate response, please send a private message, as I do not frequent these forums. Thanks!

User avatar
mrgrey
Posts: 11
Joined: Tue Jul 17, 2012 12:32 pm

Re: mjpg_streamer problems

Mon Feb 25, 2013 8:48 am

tried setting the governor to performance and it did improve FPS but did not solve the startup problems with mjpeg-streamer.

@lalee:
I've read quite a lot over the weekend and USB seems to be broken pretty well right now. I'm having those hangups you've described as well. Could you provide me with your custom kernel so I could test if it solves my problems?

lingon
Posts: 171
Joined: Fri Aug 26, 2011 7:31 am

Re: mjpg_streamer problems

Mon Feb 25, 2013 6:04 pm

lalee wrote:I also had to dive into the kernel code to fix some shamelessly unacknowledged bugs in the USB (dwc_otg) driver in my private kernel fork, which (unfixed) would occasionally break the video stream after an extended period of time.
It would be nice if you would publish your patches so that they could be included in the driver for general benefit.

dacmill4
Posts: 9
Joined: Thu Feb 28, 2013 1:04 am

Re: mjpg_streamer problems

Thu Feb 28, 2013 1:26 am

I followed the tutorial below to setup a streaming webcam, which worked great. Unfortunately, after about 7 minutes of use, the video stream freezes up. The only solution I have found so far is to <Ctrl> C, and restart the stream...
http://wolfpaulus.com/journal/embedded/ ... ypi_webcam

I would be grateful for a tutorial that solves this problem! I have witnessed the problem both when the cam is plugged into a powered USB hub, or directly into the Pi. Also occurs when connected via ethernet cable or wifi. I am curious to understand the USB bugs that were uncovered by lalee.
I am using a logitech c210 and the following settings: ./mjpg streamer -i "./input_uvc.so -n -f 10 -r 320x240" -o "./output_http.so -w ./www"
The Raspberry Pi CPU is between 4%-6%. No errors displayed when stream stops working. Help!

lalee
Posts: 6
Joined: Sun Jan 27, 2013 11:23 am

Re: mjpg_streamer problems

Thu Feb 28, 2013 5:39 pm

@mrgrey,

Most of my work is experimental at this stage, and is bundled into a privately constructed Fedora image for the Pi, which I may eventually rebrand and produce as a commercially-supported alternative. If you're interested in trying out a Beta copy of my Fedora image, though, feel free to drop a PM.
»»» If you want or need an immediate response, please send a private message, as I do not frequent these forums. Thanks!

Return to “Raspberry Pi OS”