Aardvark
Posts: 8
Joined: Fri Jan 30, 2015 4:18 pm

Re: MJPG stream is not working with kernel 3.18

Tue Feb 10, 2015 6:26 pm

There is no need for a kernel update. This is nothing wrong with the kernel and the bug report that had been filed for the kernel is now closed. Apps that are patched to properly work with the "bytesused" data behave correctly.

jtlns
Posts: 7
Joined: Tue Jun 11, 2013 7:42 am

Re: MJPG stream is not working with kernel 3.18

Wed Feb 11, 2015 9:06 am

Thanks for clarifying! So I'll have to wait for a future update of mjpg-streamer.

User avatar
mirak123
Posts: 11
Joined: Thu Jan 22, 2015 1:18 pm

Re: MJPG stream is not working with kernel 3.18

Wed Feb 11, 2015 9:12 am

Well, you can always apply the patch manually, it should be as easy as (raspberry) pie.

skingchico
Posts: 27
Joined: Mon Dec 10, 2012 5:48 am

Re: MJPG stream is not working with kernel 3.18

Fri Feb 20, 2015 3:08 pm

Thanks! Another MJPG_streamer happy user! I received my Pi 2 and thought the issue had something to do with the new board. But was wrong. Back up and running!

Steve

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

Re: MJPG stream is not working with kernel 3.18

Fri Feb 27, 2015 3:28 pm

I also try to get this running on the Pi2, also tryed the fix, but get no picture/video in the browser. I use a usb webcam which works fine till now with gstreamer.

First I got the error:
$ mjpg_streamer
MJPG Streamer Version: svn rev: 3:172M
ERROR: could not find output plugin output_http.so
Perhaps you want to adjust the search path with:
# export LD_LIBRARY_PATH=/path/to/plugin/folder
dlopen: output_http.so: cannot open shared object file: No such file or directory
I could fix this with "export LD_LIBRARY_PATH=/usr/local/lib/"

when I start mjpg_streamer I get the following:
mjpg_streamer
MJPG Streamer Version: svn rev: 3:172M
o: www-folder-path...: disabled
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
but the webpage at :8080 only shows:
404: Not Found!
Invalid input plugin number
The following brought me to the next step:
$ /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/local/lib/output_http.so -w /usr/local/www"
Now I see in the browser the "MJPG-Streamer Demo Pages". But I get no picture or video. The full log is:
$ /usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so" -o "/usr/local/lib/output_http.so -w /usr/local/www"
MJPG Streamer Version: svn rev: 3:172M
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
Adding control for Pan (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt (relative)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Pan/tilt Reset
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
Adding control for Focus (absolute)
UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device
mapping control for Pan (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt (relative)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Pan/tilt Reset
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Focus (absolute)
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Mode
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for LED1 Frequency
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Disable video processing
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
mapping control for Raw bits per pixel
UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device
o: www-folder-path...: /usr/local/www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
Is there any hints what I could do? Do I need to specify anything else for the video source?
Any help is appreciated :-)

Jonny_A
Posts: 6
Joined: Mon Feb 16, 2015 4:55 pm

Re: MJPG stream is not working with kernel 3.18

Wed Mar 04, 2015 3:34 pm

In case someone else also has problems, this worked for me:
http://sumerulabs.in/blog/2015/03/01/ru ... erry-pi-2/

Karllebolla
Posts: 1
Joined: Fri Mar 13, 2015 10:02 am

Re: MJPG stream is not working with kernel 3.18

Fri Mar 13, 2015 10:11 am

hello
First many thanks for this post.
When I call "patch -p0 <input_uvc_patch" always comes "File to patch:".
What file should I specify here?

JustCullins
Posts: 4
Joined: Fri Feb 20, 2015 7:53 pm

Re: MJPG stream is not working with kernel 3.18

Wed Mar 18, 2015 3:10 pm

yeah johnnya, those commands are not working out for it. are the commands made for the raspberry pi b+ module or raspberry pi 1

charlielife
Posts: 2
Joined: Sun Mar 22, 2015 9:00 pm

Re: MJPG stream is not working with kernel 3.18

Sun Mar 22, 2015 9:06 pm

Hi, guys:
I have the raspberry pi 2 with the last raspbian update and i was able to make mjpeg-streamer work with the following parametres:
./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -y f 15 -r 640x480" -o "./output_http.so -n -w /usr/local/www". It seems that -y and -n are very important in order to make the application run properly.

charlielife
Posts: 2
Joined: Sun Mar 22, 2015 9:00 pm

Re: MJPG stream is not working with kernel 3.18

Mon Mar 23, 2015 9:17 am

I'm sorry, the correct input is:
./mjpg_streamer -i "./input_uvc.so -d /dev/video0 -n -y f 15 -r 640x480" -o "./output_http.so -n -w /usr/local/www". Now it runs smoothly in my pi 2.

JustCullins
Posts: 4
Joined: Fri Feb 20, 2015 7:53 pm

Re: MJPG stream is not working with kernel 3.18

Mon Mar 23, 2015 8:45 pm

when i put both of those commands in i get a file not exists.

trusk
Posts: 3
Joined: Tue Apr 22, 2014 10:33 am

Re: MJPG stream is not working with kernel 3.18

Sat Apr 11, 2015 4:46 pm

Sadly, the patch did not work for me. Tried patching multiple repositories of mjpg-streamer, and there was no difference, it did not work. But I'm glad I was able to downgrade to version 3.12 all to you guys, so thanks! Been using for about 4 moths with yuyv mode, which limited me to 1 or 2 FPS, and was awful. Now I can see my turtles while I'am at work, in full 720p glory at about 20-25fps.

So thanks community, again!

braddo
Posts: 9
Joined: Wed May 06, 2015 2:20 am

Re: MJPG stream is not working with kernel 3.18

Sat May 09, 2015 1:18 am

I'm attempting this patch and getting the following error:

patching file plugins/input_uvc/input_uvc.c
Hunk #1 FAILED at 405.
Hunk #2 FAILED at 418.
2 out of 2 hunks FAILED -- saving rejects to file plugins/input_uvc/input_uvc.c.rej
patching file plugins/input_uvc/v4l2uvc.c
Reversed (or previously applied) patch detected! Assume -R? [n]

Then the messages are so filled with double negatives I don't have any idea what they mean. I just accept the defaults over and over, hoping it didn't destroy anything :-/

andrewtheart
Posts: 1
Joined: Sun Jul 19, 2015 4:55 pm

Re: MJPG stream is not working with kernel 3.18

Sun Jul 19, 2015 5:00 pm

Thanks for the information everyone; this is an unfortunate bug.

I went though absolute hell getting guvcview 2.0.1 installed on Raspbian with kernel 3.18; PJ Assis's PPA on Launchpad didn't have an armhf version of the package.

However, I did find one ... just added the below to /etc/apt/sources.list

Code: Select all

deb http://ftp.de.debian.org/debian jessie main
then

Code: Select all

sudo apt-get update
and then 2.0.1 was available

rriissee
Posts: 1
Joined: Thu Dec 10, 2015 12:47 am

Re: MJPG stream is not working with kernel 3.18

Thu Dec 10, 2015 12:56 am

mirak123 wrote:1) Download mjpg-streamer

Code: Select all

$ svn checkout svn://svn.code.sf.net/p/mjpg-streamer/code/ mjpg-streamer-code
2) Go to mjpg-streamer folder

Code: Select all

$ cd mjpg-streamer-code/mjpg-streamer
3) Safe the patch as some file, e.g. input_uvc_patch

Code: Select all

$ nano input_uvc_patch
Copy and paste the patch into input_uvc_patch file

Code: Select all

--- plugins/input_uvc/input_uvc.c       (revision 174)
+++ plugins/input_uvc/input_uvc.c       (working copy)
@@ -405,9 +405,13 @@
         if(pcontext->videoIn->formatIn == V4L2_PIX_FMT_YUYV) {
             DBG("compressing frame from input: %d\n", (int)pcontext->id);
             pglobal->in[pcontext->id].size = compress_yuyv_to_jpeg(pcontext->videoIn, pglobal->in[pcontext->id].buf, pcontext->videoIn->framesizeIn, gquality);
+            /* copy this frame's timestamp to user space */
+            pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
         } else {
             DBG("copying frame from input: %d\n", (int)pcontext->id);
-            pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->buf.bytesused);
+            pglobal->in[pcontext->id].size = memcpy_picture(pglobal->in[pcontext->id].buf, pcontext->videoIn->tmpbuffer, pcontext->videoIn->tmpbytesused);
+            /* copy this frame's timestamp to user space */
+            pglobal->in[pcontext->id].timestamp = pcontext->videoIn->tmptimestamp;
         }
 
 #if 0
@@ -418,8 +422,6 @@
         prev_size = global->size;
 #endif
 
-        /* copy this frame's timestamp to user space */
-        pglobal->in[pcontext->id].timestamp = pcontext->videoIn->buf.timestamp;
 
         /* signal fresh_frame */
         pthread_cond_broadcast(&pglobal->in[pcontext->id].db_update);
Index: plugins/input_uvc/v4l2uvc.c
===================================================================
--- plugins/input_uvc/v4l2uvc.c (revision 174)
+++ plugins/input_uvc/v4l2uvc.c (working copy)
@@ -450,6 +450,8 @@
         */
 
         memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused);
+        vd->tmpbytesused = vd->buf.bytesused;
+        vd->tmptimestamp = vd->buf.timestamp;
 
         if(debug)
             fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused);
Index: plugins/input_uvc/v4l2uvc.h
===================================================================
--- plugins/input_uvc/v4l2uvc.h (revision 174)
+++ plugins/input_uvc/v4l2uvc.h (working copy)
@@ -28,6 +28,7 @@
 
 
 #include <stdio.h>
+#include <stdint.h>
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -105,6 +106,8 @@
     int framecount;
     int recordstart;
     int recordtime;
+    uint32_t tmpbytesused;
+    struct timeval tmptimestamp;
 };
 
 /* context of each camera thread */
Save and close input_uvc_patch file
4) Apply the patch

Code: Select all

$ patch -p0 < input_uvc_patch
5) Compile it

Code: Select all

$ make USE_LIBV4L2=true clean all
6) Install it

Code: Select all

$ sudo make DESTDIR=/usr/local install
7) Run it & enjoy ;-)

Code: Select all

$ mjpg_streamer

Can You help me please!!!!. I already done all steps from 1 - 5. But i have problem with step 6 "sudo make DESTDIR=/usr/local install"
I have message:
root@raspberrypi:~/mjpg-streamer-r63# make DESTDIR=/usr/local install
make: *** No rule to make target 'install'. Stop.

daniel_moreink
Posts: 2
Joined: Tue Feb 09, 2016 10:22 am

Re: MJPG stream is not working with kernel 3.18

Tue Feb 09, 2016 10:30 am

Hello there, I really hope I'm not alone with my problem.

Besides being absolutely new to working with Pi's, I actually managed to patch mjpeg-streamer with your help to actually use mjpeg instead of YUV and boost the fps from 3 to around 15-20. This works very well via the webinterface (IP:8080) and likewise with the VLC stream function. BUT - and this is where I am stuck - I can't find a way to have OMXPlayer (Pi A runs mjpeg-streamer, Pi B runs OMXPlayer) stream from Pi A. I tried different sources, like a mp4 video I put on my server, and there was no problem whatsoever.

Did anyone else have this issue and found a solution? Any Ideas?

Thanks a lot,
Daniel

spotratz
Posts: 1
Joined: Fri Mar 04, 2016 4:13 pm

Re: MJPG stream is not working with kernel 3.18

Fri Mar 04, 2016 4:17 pm

I am in the same situation as Daniel. Many thanks for the patch that worked flawlessly and help me get real time streaming to work correctly. But I am also interested in the other end with OMXPlayer. Any assistance with that would be awesome.

Steve

jurmelius
Posts: 85
Joined: Sun Jul 22, 2012 7:00 pm

Re: MJPG stream is not working with kernel 3.18

Sat Apr 30, 2016 6:43 am

Well.. I have the same kind of problems with Jessie 03-2016.. Had to investigate myself and here is the solution
viewtopic.php?p=964326#p964326

user12345
Posts: 19
Joined: Mon Dec 22, 2014 7:06 pm

Re: MJPG stream is not working with kernel 3.18

Sun Dec 25, 2016 1:52 pm

Why you make other people live very difficult?
You make a patch public, its clear the patch works only for a special Version of input_uvc.c an will fail at other Versions.
You dont give a source for the special Version.
Why to hell you dont upload a whole package of mjpg-streamer with included patched input_uvc.c???

The Patch didnt work, first it dont find the file. If you give it the full path it says "malformed patch at line 4"

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 70 guests