MacHack
Posts: 21
Joined: Sat May 19, 2012 1:00 pm

Re: Streaming mjpg from Raspberry Cam

Tue Oct 29, 2013 10:33 am

Hi,
I have something new for you.
Using the resizer code from wibble82 from his api http://www.raspberrypi.org/phpBB3/viewt ... 43&t=59300, I've written a bit of code that let you have full field of view with the video port. As the binning is still missing, there is a 15 fps limitation.
I added the "-fullfov" parameter which enables the full field of view. Obviously, this parameter has no effect if you use -usestills. Enabling the "-fullfov" option will automatically limit the framerate at 15 fps.

I haven't had time to test it completely so use it at your own risk, there might still be some bug that would need a reboot.
Have fun with it.
Attachments
input_raspicam.c.tar.gz
(8.36 KiB) Downloaded 495 times

Hodofca
Posts: 7
Joined: Fri Oct 18, 2013 8:23 am

Re: Streaming mjpg from Raspberry Cam

Tue Oct 29, 2013 12:43 pm

MacHack wrote:Hi,
I have something new for you.
Using the resizer code from wibble82 from his api http://www.raspberrypi.org/phpBB3/viewt ... 43&t=59300, I've written a bit of code that let you have full field of view with the video port. As the binning is still missing, there is a 15 fps limitation.
I added the "-fullfov" parameter which enables the full field of view. Obviously, this parameter has no effect if you use -usestills. Enabling the "-fullfov" option will automatically limit the framerate at 15 fps.

I haven't had time to test it completely so use it at your own risk, there might still be some bug that would need a reboot.
Have fun with it.
Hi. It looks promissing. I really would like to test it out but can you give some instruction for a newbie how to install it? I've just copied this file into my mjpeg folder on my raspberry, did "make clean all" and now i use:

Code: Select all

 LD_LIBRARY_PATH=/home/pi/mjpg mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so -x 800 -y 480 -fps 2 -ex sports -fullfov"
but its simply not recognizing -fullfov option
Without it everything works for me without issues.

tiger79
Posts: 15
Joined: Mon Sep 09, 2013 8:49 am

Re: Streaming mjpg from Raspberry Cam

Wed Oct 30, 2013 3:14 pm

Hodofca you are getting better framerates now ?
Like the 15 fps mentioned by jacksonliam ?

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

Re: Streaming mjpg from Raspberry Cam

Wed Oct 30, 2013 8:11 pm

MacHack wrote:Hi,
I have something new for you.
Using the resizer code from wibble82 from his api http://www.raspberrypi.org/phpBB3/viewt ... 43&t=59300, I've written a bit of code that let you have full field of view with the video port. As the binning is still missing, there is a 15 fps limitation.
I added the "-fullfov" parameter which enables the full field of view. Obviously, this parameter has no effect if you use -usestills. Enabling the "-fullfov" option will automatically limit the framerate at 15 fps.

I haven't had time to test it completely so use it at your own risk, there might still be some bug that would need a reboot.
Have fun with it.
Nice! I'll try and merge that at the weekend. Does that pull a full 5MP frame from the camera, feed it into the resizer component to turn the full frame into the requested resolution then the encoder to encode it to JPEG? Didn't realise you could pull 5MP frames from the camera that quickly!

Hodofca
Posts: 7
Joined: Fri Oct 18, 2013 8:23 am

Re: Streaming mjpg from Raspberry Cam

Wed Oct 30, 2013 8:15 pm

tiger79 wrote:Hodofca you are getting better framerates now ?
Like the 15 fps mentioned by jacksonliam ?
No. Still the same but i think that i dont need so much fps for my surveillance cam. now i set my cam to 3 fps -ex sports and it's enought.

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

Re: Streaming mjpg from Raspberry Cam

Wed Oct 30, 2013 8:30 pm

Hodofca wrote:
tiger79 wrote:Hodofca you are getting better framerates now ?
Like the 15 fps mentioned by jacksonliam ?
No. Still the same but i think that i dont need so much fps for my surveillance cam. now i set my cam to 3 fps -ex sports and it's enought.
Tiger79 are you seeing this too? If its a problem with the code I'm interested in fixing it!

Hodofca, how are you measuring the FPS when you have it set to e.g. "-fps 15" and are not using "-usestills", because the plugin only outputs the measured framerate when using "-usestills".

Hodofca
Posts: 7
Joined: Fri Oct 18, 2013 8:23 am

Re: Streaming mjpg from Raspberry Cam

Wed Oct 30, 2013 10:52 pm

jacksonliam wrote:
Hodofca wrote:
tiger79 wrote:Hodofca you are getting better framerates now ?
Like the 15 fps mentioned by jacksonliam ?
No. Still the same but i think that i dont need so much fps for my surveillance cam. now i set my cam to 3 fps -ex sports and it's enought.
Tiger79 are you seeing this too? If its a problem with the code I'm interested in fixing it!

Hodofca, how are you measuring the FPS when you have it set to e.g. "-fps 15" and are not using "-usestills", because the plugin only outputs the measured framerate when using "-usestills".
I use iSpy 64 v.5.5.8.0
I know that this soft shows a bit lower framerate compared to just looking at the output using web browser, but well..i dont know any other method to check fps. Another thing is that iSpy is not even showing 1080p (in web browser no problem).

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

Re: Streaming mjpg from Raspberry Cam

Thu Oct 31, 2013 7:29 pm

Hodofca wrote:
I use iSpy 64 v.5.5.8.0
I know that this soft shows a bit lower framerate compared to just looking at the output using web browser, but well..i dont know any other method to check fps. Another thing is that iSpy is not even showing 1080p (in web browser no problem).
I think this is an iSpy issue, not an issue with mjpg-streamer.
VLC will show the stream, but not as well as a web browser and it does not calculate the FPS. The problem is, mjpg works by capturing frames and then the client requests frames as fast as it can from the server. Any display of the FPS on the client side is going to be an average/estimate.

Todd Alan
Posts: 6
Joined: Sat Jun 22, 2013 12:59 am

Re: Streaming mjpg from Raspberry Cam

Fri Nov 01, 2013 7:20 am

Heads up!!!!! A new version of the Video4Linux2 driver for the Raspberry Pi Camera Board is out! This is really slick I have it running at 30fps, practically 0 latency. I'm streaming over my edimax 7811. This is the solution that I have been looking for. check it out http://www.linux-projects.org/modules/n ... toryid=154

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1442
Joined: Sat Sep 10, 2011 11:43 am

Re: Streaming mjpg from Raspberry Cam

Fri Nov 01, 2013 7:40 am

Is this still using the user mode implementation?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: Streaming mjpg from Raspberry Cam

Fri Nov 01, 2013 6:07 pm

Todd Alan wrote:Heads up!!!!! A new version of the Video4Linux2 driver for the Raspberry Pi Camera Board is out! This is really slick I have it running at 30fps, practically 0 latency. I'm streaming over my edimax 7811. This is the solution that I have been looking for. check it out http://www.linux-projects.org/modules/n ... toryid=154
I think that is using the same mmal API's as this to get fast JPEGs. This should actually be a tiny bit more resource-friendly if you want mjpg-streamer rather than using the v4l2 plugin with that driver!
gsh wrote:Is this still using the user mode implementation?

Gordon
Sorry, I don't quite understand the question! My mjpg-streamer raspicam plugin (which is what this thread has mostly become about) uses mmal to put the camera in either stills or video mode sending the frames through the jpeg-encoder and writes the resulting output directly to the mjpg-streamer buffers.

Todd Alan
Posts: 6
Joined: Sat Jun 22, 2013 12:59 am

Re: Streaming mjpg from Raspberry Cam

Fri Nov 01, 2013 6:54 pm

jacksonliam wrote:
Todd Alan wrote:Heads up!!!!! A new version of the Video4Linux2 driver for the Raspberry Pi Camera Board is out! This is really slick I have it running at 30fps, practically 0 latency. I'm streaming over my edimax 7811. This is the solution that I have been looking for. check it out http://www.linux-projects.org/modules/n ... toryid=154
I think that is using the same mmal API's as this to get fast JPEGs. This should actually be a tiny bit more resource-friendly if you want mjpg-streamer rather than using the v4l2 plugin with that driver!
gsh wrote:Is this still using the user mode implementation?

Gordon
Sorry, I don't quite understand the question! My mjpg-streamer raspicam plugin (which is what this thread has mostly become about) uses mmal to put the camera in either stills or video mode sending the frames through the jpeg-encoder and writes the resulting output directly to the mjpg-streamer buffers.
Todd wrote: I was getting ready to implement your raspicam plugin when I found this update. I am using mjpg-streamer with the new driver. I want to incorporate the raspicam plugin next so I can get the video running in the background. Soon this driver will have the ability to implement text into the stream

rmsalinas
Posts: 12
Joined: Tue Sep 03, 2013 3:44 pm

Re: Streaming mjpg from Raspberry Cam

Fri Nov 01, 2013 8:25 pm

Hi guys,

I've just created a library in C++ for controlling the camera. You might be interested in it. Take a look at

http://www.uco.es/investiga/grupos/ava/node/40


Cheers
Rafa

tiger79
Posts: 15
Joined: Mon Sep 09, 2013 8:49 am

Re: Streaming mjpg from Raspberry Cam

Mon Nov 04, 2013 12:43 pm

jacksonliam wrote:
Hodofca wrote:
tiger79 wrote: Tiger79 are you seeing this too? If its a problem with the code I'm interested in fixing it!
.
Hi,
I cannot test atm but if possible I will pick it up this week to see if I am getting the results I have been hoping for (640x480 at 15fps with 8-10% cpu usage, actually what I am able to do now with a BeagleBone Black)....

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 3:03 am

gsh wrote:Is this still using the user mode implementation?
There's probably only one good reason (and many bad reasons) to have a driver in kernel space if you can have one in user space, but considering this camera on the rpi, the little benefit is not worth the effort.

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 6:59 am

MacHack wrote:Using the resizer code from wibble82 from his api http://www.raspberrypi.org/phpBB3/viewt ... 43&t=59300, I've written a bit of code that let you have full field of view with the video port. As the binning is still missing, there is a 15 fps limitation.
I added the "-fullfov" parameter which enables the full field of view. Obviously, this parameter has no effect if you use -usestills. Enabling the "-fullfov" option will automatically limit the framerate at 15 fps.
I would very much like to try this out. Is the code available? How can I try it?

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1442
Joined: Sat Sep 10, 2011 11:43 am

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 7:14 am

RpiName wrote:
gsh wrote:Is this still using the user mode implementation?
There's probably only one good reason (and many bad reasons) to have a driver in kernel space if you can have one in user space, but considering this camera on the rpi, the little benefit is not worth the effort.
You don't state what your reasons are what are the many bad reasons? I can only think of one which is it's slightly more difficult to maintain because debugging is more difficult but otherwise ...

Also where's the source, is it closed source as well?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 9:17 am

gsh wrote:Also where's the source, is it closed source as well?
As being open source is not really in the spirit of Broadcom, funding/investing in an userspace driver is one more way to keep their sauce secret. Not that I would be happy for that, but it's more coherent with the closed source nature of the rpi.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1442
Joined: Sat Sep 10, 2011 11:43 am

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 9:45 am

RpiName wrote:
gsh wrote:Also where's the source, is it closed source as well?
As being open source is not really in the spirit of Broadcom, funding/investing in an userspace driver is one more way to keep their sauce secret. Not that I would be happy for that, but it's more coherent with the closed source nature of the rpi.
Troll alert...

Lets get your facts straight first shall we:

1) Broadcom has completely open sourced all ARM side code so saying that is just trolling which will get you banned
2) Neither Raspberry Pi or Broadcom is funding a user space driver - open or closed source. We are funding the right way to do it, i.e. a kernel driver that for some reason you originally said is the wrong way to do it.
3) Closed source nature of the RPi see 1 above

Gordon Hollingworth (Director of Engineering, Raspberry Pi so I know what I'm talking about)
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 10:27 am

gsh wrote: 1) Broadcom has completely open sourced all ARM side code so saying that is just trolling which will get you banned
2) Neither Raspberry Pi or Broadcom is funding a user space driver - open or closed source. We are funding the right way to do it, i.e. a kernel driver that for some reason you originally said is the wrong way to do it.
3) Closed source nature of the RPi see 1 above
Either you misunderstood what I am trying to say or I did not explain my point well.

1-3) That's exactly what I am saying: the GPU code (the "secret sauce") which is called by the open-source ARM side "wrapper" is still closed-source, isn'it?

2) I did not say that. I was suggesting to consider an userspace driver (open source or not) as an alternative to easily keep some GPU implementation secret while profiting by the userspace stack already developed. I am not sure this would be so easy with a kernel driver.
Last edited by RpiName on Wed Nov 06, 2013 10:30 am, edited 1 time in total.

MacHack
Posts: 21
Joined: Sat May 19, 2012 1:00 pm

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 10:29 am

jbeale wrote:
MacHack wrote:Using the resizer code from wibble82 from his api http://www.raspberrypi.org/phpBB3/viewt ... 43&t=59300, I've written a bit of code that let you have full field of view with the video port. As the binning is still missing, there is a 15 fps limitation.
I added the "-fullfov" parameter which enables the full field of view. Obviously, this parameter has no effect if you use -usestills. Enabling the "-fullfov" option will automatically limit the framerate at 15 fps.
I would very much like to try this out. Is the code available? How can I try it?
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.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23918
Joined: Sat Jul 30, 2011 7:41 pm

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 10:31 am

RpiName wrote:
gsh wrote: 1) Broadcom has completely open sourced all ARM side code so saying that is just trolling which will get you banned
2) Neither Raspberry Pi or Broadcom is funding a user space driver - open or closed source. We are funding the right way to do it, i.e. a kernel driver that for some reason you originally said is the wrong way to do it.
3) Closed source nature of the RPi see 1 above
Either you misunderstood what I am trying to say or I did not explained my point well.

1-3) That's exactly what I am saying: the GPU code (the "secret sauce") which is called by the open-source ARM side "wrapper" is still closed-source, isn'it?

2) I did not say that. I was suggesting to consider an userspace driver (open source or not) as an alternative to easily keep some GPU implementation secret while profiting by the userspace stack already developed. I am not sure this would be so easy with a kernel driver.
1. The GPU is and always has been a binary blob, and closed source. That has nothing to do with a user space or kernel driver for the camera - both of which are ARM side. I believe the userspace driver is closed source - ( I could be wrong) this is nothing to do with either the Foundation or Broadcom. The kernel driver will be OSS when it is released.

2. That doesn't make sense. The kernel driver will be using exactly the same interface to the GPU as the userspace one, but will by its nature use it more effectively. It's nothing to do with keeping stuff secret - and I repeat, the kernel driver will be OSS, as it has to be.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1442
Joined: Sat Sep 10, 2011 11:43 am

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 10:35 am

I was assuming you had something useful to add but obviously not

Thanks

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 10:42 am

jamesh wrote:The kernel driver will be using exactly the same interface to the GPU as the userspace one
Okay, thanks for the clarification.

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

Re: Streaming mjpg from Raspberry Cam

Wed Nov 06, 2013 4:54 pm

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

Return to “Camera board”