User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 7:44 pm

corncrake wrote:Hi All,

Thanks for your work here - have this in use with a bird feeder. I use this to provide a stream to another machine running motion.

I am experience the fade to black issue ( after maybe 3 hours running ) and I would like to slow down the default frame rate. I have tried "-fps 0.5" but this seems to speed up, not slow down the fps and the -d delay parameter is not working for me.

Any help appreciated.

John
I don't think this accepts decimal framerates, 0.5 might even be interpreted as 5!

First make sure your upto date with "sudo rpi-update" and "sudo apt-get update && sudo apt get upgrade"
If not try "--usestills --fps 1". And while the "-ex" params have caused issues in the passed, I believe they work on the latest firmware, then try with "-ex night".
MacHack wrote: I think jacksonliam may add it the github quite soon and remove some bugs in it.
By the way, jacksonliam, if you do it, I think I forgot to destroy the resizer at the end of my code which could result in a lock up of the camera and need a reboot.

Have fun with it.
I'll merge it this weekend if I get a chance, though I have a new HP Microserver and Soundbar to play with so maybe not :D
Thanks for the heads up!

corncrake
Posts: 2
Joined: Wed Nov 06, 2013 4:40 pm

Re: Streaming mjpg from Raspberry Cam

Thu Nov 07, 2013 4:14 pm

jacksonliam wrote: I don't think this accepts decimal framerates, 0.5 might even be interpreted as 5!

First make sure your upto date with "sudo rpi-update" and "sudo apt-get update && sudo apt get upgrade"
If not try "--usestills --fps 1". And while the "-ex" params have caused issues in the passed, I believe they work on the latest firmware, then try with "-ex night".
Thanks Liam,
I think --usestills --fps 1 is giving me better results, no fade to black. so far.
One other question, what is the key difference between using this method ( which I could not get to work)
http://blog.miguelgrinberg.com/post/how ... spberry-pi
and your version ( which is the only one that worked for me ) ?

The reason I ask is that I'm running the pi from battery and a solar panel and was wondering was one method more "efficient" power wise than the other or is it much of a muchness.

Thanks John

User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming mjpg from Raspberry Cam

Wed Nov 13, 2013 9:09 pm

corncrake wrote:
jacksonliam wrote: I don't think this accepts decimal framerates, 0.5 might even be interpreted as 5!

First make sure your upto date with "sudo rpi-update" and "sudo apt-get update && sudo apt get upgrade"
If not try "--usestills --fps 1". And while the "-ex" params have caused issues in the passed, I believe they work on the latest firmware, then try with "-ex night".
Thanks Liam,
I think --usestills --fps 1 is giving me better results, no fade to black. so far.
One other question, what is the key difference between using this method ( which I could not get to work)
http://blog.miguelgrinberg.com/post/how ... spberry-pi
and your version ( which is the only one that worked for me ) ?

The reason I ask is that I'm running the pi from battery and a solar panel and was wondering was one method more "efficient" power wise than the other or is it much of a muchness.

Thanks John
Interesting, that runs it in stills mode and so does this with the "--usestills" option.
It could be that your regulator isn't upto it, it might be dropping below 5V causing some issues. I expect the video mode does use a bit more power, what RAM split are you using?
Does running raspivid for a long time give you the fade to black?

tombaky
Posts: 3
Joined: Sun Sep 01, 2013 7:39 am

Re: Streaming mjpg from Raspberry Cam

Sun Nov 17, 2013 12:37 pm

MacHack wrote:
Hi,
to try this, follow the same instructions as for my previous patch. For clarity purposes, I'll rewrite it here.
You need to download the file from my previous post and extract it.
After, you need to clone the github from jacksonliam https://github.com/jacksonliam/mjpg-streamer and replace the file mjpg-streamer/mjpg-streamer-experimental/plugins/input_raspicam/input_raspicam.c by the one you've just extracted. Then build mjpeg-streamer.

I think jacksonliam may add it the github quite soon and remove some bugs in it.
By the way, jacksonliam, if you do it, I think I forgot to destroy the resizer at the end of my code which could result in a lock up of the camera and need a reboot.

Have fun with it.
It is working really fine, I have been testing it for few hours now.
Thank you for your work :D

Tombaky

Qbaz
Posts: 5
Joined: Thu Nov 07, 2013 11:28 am

Re: Streaming mjpg from Raspberry Cam

Fri Nov 22, 2013 3:28 pm

Hello,
First, thanks for your work. It helps me a lot.

I try to make script to execute camera stream when system starts.

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/output_http.so -w ./www" -i "input_raspicam.so -fps 20 -x 320 -y 240 -vf -sh 50"
It gives me arror like this when I try to watch stream on my browser:
404: Not Found!
Could not open file
Do you have any idea how to solve this?

Another thing, I have about 10 fps at 320x240 and about 5-6 fps at 640x480. Is there any way to make it better?

@EDIT

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/output_http.so -w /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/www" -i "input_raspicam.so -fps 20 -x 320 -y 240 -vf -sh 50"
Adding path to /www helps.

I also change quality to 10%, now I have ~10fps at 800x600, ~13fps at 640x480 and ~20fps at 320x240.

User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming mjpg from Raspberry Cam

Sat Dec 07, 2013 12:00 pm

Qbaz wrote:Hello,
First, thanks for your work. It helps me a lot.

I try to make script to execute camera stream when system starts.

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/output_http.so -w ./www" -i "input_raspicam.so -fps 20 -x 320 -y 240 -vf -sh 50"
It gives me arror like this when I try to watch stream on my browser:
404: Not Found!
Could not open file
Do you have any idea how to solve this?

Another thing, I have about 10 fps at 320x240 and about 5-6 fps at 640x480. Is there any way to make it better?

@EDIT

Code: Select all

#!/bin/bash
export LD_LIBRARY_PATH=/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/mjpg_streamer -o "/home/pi/mjpg-streamer-master/mjpg-streamer-experimental/output_http.so -w /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/www" -i "input_raspicam.so -fps 20 -x 320 -y 240 -vf -sh 50"
Adding path to /www helps.

I also change quality to 10%, now I have ~10fps at 800x600, ~13fps at 640x480 and ~20fps at 320x240.
Sorry for the slow reply, Its been a busy few weeks for me! I have big plans for my next rpi-cam project, I want smooth and as latency-free as possible mjpeg and dynamic h264 live streaming with the ability to install via apt-get / raspi store and change the display properties 'on the fly'. I also would like it to show up as a DLNA source so it can be shown easily on TVs. But I'm getting ahead of myself.

I'm not the best at bash but perhaps this works:

Code: Select all

#!/bin/bash
cd /home/pi/mjpg-streamer-master/mjpg-streamer-experimental/
export LD_LIBRARY_PATH=.
mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so -fps 20 -x 320 -y 240 -vf -sh 50"
How are you measuring the framerate? Make sure the sh flag isn't causing it to be low, but from those flags it looks like framerate should be fine.

Cromfel
Posts: 11
Joined: Thu Aug 30, 2012 12:43 pm

Re: Streaming mjpg from Raspberry Cam

Thu Jan 30, 2014 12:15 pm

Liam it was inspiring me how valuable contribution you are doing. I specifically had to come login and say thanks for your work! :shock:

jussi24
Posts: 64
Joined: Fri Jul 26, 2013 11:30 am

Re: Streaming mjpg from Raspberry Cam

Sun Feb 23, 2014 10:27 am

Hi jacksonliam
Sorry for the slow reply, Its been a busy few weeks for me! I have big plans for my next rpi-cam project, I want smooth and as latency-free as possible mjpeg and dynamic h264 live streaming with the ability to install via apt-get / raspi store and change the display properties 'on the fly'. I also would like it to show up as a DLNA source so it can be shown easily on TVs. But I'm getting ahead of myself.
Sounds this could merge all the needs together one (me) might have when building a raspi based webcam.
Offtopic here. Where can I stay tuned to this project to not miss any news?
Thanks a lot!

User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming mjpg from Raspberry Cam

Mon Feb 24, 2014 8:02 pm

I'll reply here if I've got any progress, though the other MJPEG streamer looks promising http://www.raspberrypi.org/phpBB3/viewt ... 43&t=61771

User avatar
theoB610
Posts: 233
Joined: Sat Jan 05, 2013 12:40 pm
Location: Devon

Re: Streaming mjpg from Raspberry Cam

Wed Feb 26, 2014 1:39 pm

Has anyone tried doing this with the pure python interface?

Kenairod
Posts: 3
Joined: Thu Mar 06, 2014 10:38 am

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 10:47 am

Hi,
When I try to enter the command

Code: Select all

raspistill -tl 500 -t 999999 -vf -w 960 -h 720 -o /tmp/mjpg/test.jpg -n -q 50&
I get this error

Code: Select all

mmal: main: Error opening output file: /tmp/mjpg/test.jpg2672~
No output file will be generated
(the number at the end of the file name is the PID of the process)

And when I try to run it in sudo i get this error :

Code: Select all

mmal: main: Error opening output file: /tmp/mjpg/test.jpg~
No output file will be generated
I don't have much idea why it happens...
I also tried this method http://blog.miguelgrinberg.com/post/how ... -pi/page/5 of installation of MJPEG-Streamer so maybe is their a confilct with this.

At the end I would like to do as they do at the end of this article : http://sanjosetech.blogspot.co.uk/2013/ ... pi-to.html and play the stream in an android application in live with the less delay possible (it's to control a remote car with video). But their solution only works with a USB camera not the RaspiCam...


EDIT : Well, actually the error was due to the fact there was no /tmp/mjpg directory, fixed with a simple mkdir... Sorry ^^

But now I come with an other error when I try to run

Code: Select all

mjpg_streamer -i 'input_file.so -f /tmp/mjpg -r'
I get this error :

Code: Select all

MJPG Streamer Version: svn rev: 
ERROR: could not find input plugin
       Perhaps you want to adjust the search path with:
       # export LD_LIBRARY_PATH=/path/to/plugin/folder
       dlopen: input_file.so: cannot open shared object file: No such file or directory

User avatar
blackdot
Posts: 7
Joined: Sat May 12, 2012 8:48 pm

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 12:54 pm

Kenairod wrote:

Code: Select all

mjpg_streamer -i 'input_file.so -f /tmp/mjpg -r'
One of the way, how you can avoid this problem is to specify full path for input_file.so.

Kenairod
Posts: 3
Joined: Thu Mar 06, 2014 10:38 am

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 1:40 pm

Well I've run

Code: Select all

find / 'input_file.so'
But it didn't find anything : find: `input_file.so': No such file or directory

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 1:55 pm

Try this:

Code: Select all

sudo find / -name input_file.so -print
my files are in /usr/local/lib/

Kenairod
Posts: 3
Joined: Thu Mar 06, 2014 10:38 am

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 3:06 pm

Thanks a lot, but now I got an other error, similar, but about the output library... And I don't know where to fix this one :cry:

Code: Select all

[email protected] ~ $ mjpg_streamer -i '/usr/local/lib/input_file.so -f /tmp/mjpg -r'
MJPG Streamer Version: svn rev: 
 i: folder to watch...: /tmp/mjpg/
 i: forced delay......: 0
 i: delete file.......: yes, delete
 i: filename must be..: -no filter for certain filename set-
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
(it's located in the same directory as the input library)

User avatar
blackdot
Posts: 7
Joined: Sat May 12, 2012 8:48 pm

Re: Streaming mjpg from Raspberry Cam

Thu Mar 06, 2014 3:25 pm

In this case, easiest way for you will be this one:

Code: Select all

$ export LD_LIBRARY_PATH=/usr/local/lib
$ mjpg_streamer -i 'input_file.so -f /tmp/mjpg -r'

Questionario
Posts: 40
Joined: Tue Jun 04, 2013 6:22 am

Re: Streaming mjpg from Raspberry Cam

Thu Mar 20, 2014 1:50 pm

jacksonliam wrote:I'll reply here if I've got any progress, though the other MJPEG streamer looks promising http://www.raspberrypi.org/phpBB3/viewt ... 43&t=61771
But you're still working on it or you're referring us to the new RPi Cam Control project?
streaming to TV via dlna sounds very interesting.... :)

ladegro
Posts: 2
Joined: Tue Apr 08, 2014 9:28 am

Re: Streaming mjpg from Raspberry Cam

Tue Apr 08, 2014 9:34 am

I'm keeping an eye on this thread with the goal to end up with a full HD streaming security/front-door cam using zoneminder.
The recent -fullfov option as hacked into jacksonliam's experimental version works great and is really useful.

My only problem is that I'm only able to reach 1920x1088 at 2 fps with

Code: Select all

 mjpg_streamer_experimental -i "/usr/git/mjpg-streamer/mjpg-streamer-experimental/input_raspicam.so -fps 10 -x 1920 -y 1088" -o "/usr/git/mjpg-streamer/mjpg-streamer-experimental/output_http.so -p 10088 -w /usr/local/www"
as where I'm able to reach 1920x1088 at 11 fps with

Code: Select all

 mjpg_streamer -i "/usr/local/lib/input_uvc.so -n -f 10 -r 1920x1088 -l off" -o "/usr/local/lib/output_http.so -p 10088 -w
 /usr/local/www"
But the input_uvc.so doesn't know of the -fullfov option.

Apart from that, what is causing this major performance difference between the two input modules? It'd be great to be able to combine the performance of the input_uvc with the options of the input_raspicam.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: Streaming mjpg from Raspberry Cam

Wed Apr 09, 2014 7:48 am

What does that --fullfov option do?
I believe the new v4l2 driver can provide full view on videos. So why do you need --fullfov?

ladegro
Posts: 2
Joined: Tue Apr 08, 2014 9:28 am

Re: Streaming mjpg from Raspberry Cam

Wed Apr 09, 2014 7:17 pm

Well the fullfov option results in a much wider field of view as opposed to the regular mjpeg_streamer. It might well be possible that the new feature in the v4l2 driver isn't yet correctly used by mjpeg_streamer? Or shouldn't I have to change anything...

Devinel
Posts: 2
Joined: Thu Apr 10, 2014 3:03 pm

Re: Streaming mjpg from Raspberry Cam

Thu Apr 10, 2014 3:12 pm

hey Guys, can someone post a noobfriendly tutorial how to get lians plugin to work ? im just too new to handle this downloading and extracting .... plz guys ? it wouldn take long. I just managed to get the normal Streamer working but i cant get above 1.5 fps. would be great!

User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming mjpg from Raspberry Cam

Mon Apr 14, 2014 5:28 pm

ladegro wrote:Well the fullfov option results in a much wider field of view as opposed to the regular mjpeg_streamer. It might well be possible that the new feature in the v4l2 driver isn't yet correctly used by mjpeg_streamer? Or shouldn't I have to change anything...
The full FOV patch in this thread captures single frames and feeds them through the GPU's image resizer IIRC.

The v4l2 driver does pixel binning IIRC - so I'd use that for full FOV for now - unless there's a reason to use this over the v4l2 driver?
Is there a reason for 1920x1088? Is that a typo of 1920x1080?

You can get about 8fps by using -usestills with plugin. I do remember getting a bigger FOV from that. But I'm not sure how that does scaling - I think it just crops. So the bigger FOV may have just come from streaming the full 5MP frames.

b4dpxl
Posts: 6
Joined: Wed Sep 17, 2014 10:45 am

Re: Streaming mjpg from Raspberry Cam

Wed Sep 17, 2014 11:14 am

Hi jacksonliam. Is your library still being developed? If so, are you accepting feature requests?

I only need a low framerate to be streamed, say 5fps, but if I capture at that there is a lot of motion blur that disappears when capturing at ~15fps. Would it be possible to capture at 15fps but stream at a lower rate?

Thanks

RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: Streaming mjpg from Raspberry Cam

Tue Sep 23, 2014 11:16 pm

Here is a new HTTP streaming server (mjpeg video, jpeg stills, h264) with web device control panel:
http://www.linux-projects.org/modules/n ... toryid=166

User avatar
jbeale
Posts: 3500
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Streaming mjpg from Raspberry Cam

Wed Oct 01, 2014 4:52 pm

RpiName wrote:Here is a new HTTP streaming server (mjpeg video, jpeg stills, h264) with web device control panel:
http://www.linux-projects.org/modules/n ... toryid=166
This is a convenient tool, thank you.

One comment: changing the resolution is strange. For example, 640x480 mode shows me the full frame, as expected. But changing to 640x360 to see the 16x9 video aspect ratio, it does not do a center-crop (like the output of raspivid in 16x9 mode). Instead it crops off just the bottom, and leaves the top edge in the same place, so the center of the displayed image has shifted up relative to 4x3 mode display. I think this would not happen if you were calling MMAL to change the resolution, so apparently you are actually acquiring 640x480 and then cropping the bottom edge only to reach 640 x 360? Or you are using the MMAL "crop/zoom" function instead of setting the final resolution?

I wanted to use this to install and position a camera (which will be used in 16x9 mode) while I monitored it with a tablet, but it's not so useful when it doesn't show me the same framing as raspivid and the other RPi video software.

Also, after apt-get removing everything that I apt-get installed, I find that I still have to clean out /etc/environment to avoid

Code: Select all

ERROR: ld.so: object '/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so' from LD_PRELOAD cannot be preloaded: ignored.
appearing after every single line I type at the bash shell.

Return to “Camera board”