channelz
Posts: 5
Joined: Mon Feb 09, 2015 8:24 pm

Re: Streaming mjpg from Raspberry Cam

Mon Nov 07, 2016 5:16 pm

When using mjpg-streamer with awb=off , how do I control the gains?

Code: Select all

./mjpg_streamer -i './input_raspicam.so -x 1296 -y 730 -ISO 100 -fps 0 -sh 2 -co 15 -br 46 -awb off' -o './output_http.so -w ./www -p 8080'
Didn't find anything in the documentation.
-awbg or -awb_gains didn't work

using raspivid it would be:

Code: Select all

raspivid -awb off -awbg 1.5,1.65 -t 0
Cheers.

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

Re: Streaming mjpg from Raspberry Cam

Mon Nov 07, 2016 7:48 pm

There are these options that might be what you're looking for:
awbgainR
awbgainB

Haven't tested them though!

channelz
Posts: 5
Joined: Mon Feb 09, 2015 8:24 pm

Re: Streaming mjpg from Raspberry Cam

Mon Nov 07, 2016 8:46 pm

That does look what I was looking for ! Thanks!

Just checked the code for the plugin version I have. It stops at option //25 (preview).

And awbgainR and awbgainB are //30 and //31.

I will download the latest and recompile later and report back. thanks again.
Cheers.

channelz
Posts: 5
Joined: Mon Feb 09, 2015 8:24 pm

Re: Streaming mjpg from Raspberry Cam

Tue Nov 08, 2016 3:30 pm

I can confirm the options -awbgainB and -awbgainR work with the current build. Cheers!

bsculley
Posts: 1
Joined: Mon Jan 09, 2017 1:10 pm

Re: Streaming mjpg from Raspberry Cam

Mon Jan 09, 2017 1:28 pm

Hi, I'm posting this here to try to avoid starting another thread. I hope that works out.

I am using the octopi application on RPi 3 with the pi cam. Everything works, but the streaming video is very slow and laggy. Also the image is out of focus.

I'm pretty familiar with debian, but I didn't build any of these components and I don't know how they interact, most particularly, how mjpg-stream gets started.

Short question is, does anybody know how to increase the frame rate, decrease the latency and adjust the focus on the pi cam? I'm looking for which files to edit and what to put in them.

As I understand it RPi 3 should have plenty of bandwidth to handle the video.

Thanks,

vibez
Posts: 27
Joined: Thu Aug 15, 2013 11:30 am

Re: Streaming mjpg from Raspberry Cam

Mon Jan 23, 2017 12:54 pm

Does anyone know why the -ISO command doesn't work? ISO remains the same no matter how I set it.

Code: Select all

-fps 30 -x 640 -y 480 -ISO 100 -vf

ping2010
Posts: 4
Joined: Sat Jan 19, 2013 8:01 pm

Re: Streaming mjpg from Raspberry Cam

Tue Jan 24, 2017 4:45 pm

in plugins/input-uvc/v4l2uvc.c the buffer should be requeued after an empty buffer detection (line 571)
with ret = xioctl(vd->fd, VIDIOC_QBUF, &vd->buf);

Program works great with a uvc webcam connected to a usb-port of a raspberry pi

JoseTMR
Posts: 1
Joined: Tue Apr 11, 2017 4:17 am

Re: Streaming mjpg from Raspberry Cam

Tue Apr 11, 2017 4:23 am

I am in desperate need of assistance. I am trying to change the port for mjpg-streamer to 8090 as the default 8080 is used by another pi on the same network. I have followed several tutorials I have found and have made no progress. I was able to change the listening port using haproxy for the Pi but that is as far as I have gotten. Any assistance would be GREATLY appreciated !!

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Streaming mjpg from Raspberry Cam

Mon May 01, 2017 2:40 pm

Jose,
I've been fiddling with the Streaming Mjp source with an aim to remote my Mead ETX125 telescope. I've just found that the clever people have updated the Github source about 20 days ago so will need to get a new image and start over. Suggest other folk flying this one do the same.

However, having the lid off I can answer your question re changing the web port from 8080 to 8090 (or I guess anything else sensible) and what I did worked (or seemed to). I also found "Searchmonkey" on my Ubuntu laptop very useful to search through the source directories to locate instances of 8080. There are two, one an integer the other a string (although the new, previous, release(s) may have changed this). I changed both instances:

The integer is in:
./plugins/output_http/output_http.c as port = htons(8080);

and the string in:
./plugins/input_http/mjpg-proxy.c. as state->port = strdup("8080");

So, use nano and Control-W to search for instances of 8080 and change them. Then re-make the whole lot. I assume you must have already met the wonders of make.

Would also be happy to accept guidance from anyone that knows better on this one.

My eventual aim is to control my Meade ETX125 telescope using streamer to export and capture images. I need to add a focuser step motor and the means to control it via the current web interface. I did feel the current control interface a bit cranky and now know what I need to get my bits going.

Edit: I aim to include a means whereby I can shut it all down through the web interface to avoid little accidents on power-offs. Can then go unplug it in slow time.

The next bit will be to include the "Telescopeserver" application that "Stellarium" talks to to drive serial commands to the telescope. Here the aim is to allow "Stellarium" continued control but also allow the streamer web interface to tweek the ultimate Az/Alt then use the modified streamer to focus, control camera functions and take pictures dynamically via the web interface. I am not clear whether any new features in the Pi-camera command line programs have propagated into the streamer camera source or indeed what I need to do. Actually its still all a bit of a mystery.

Happy to share what I'm doing but haven't a clue about Github and don't have any particular time line. Trying to keep it fun.
(116007 thread reads at this point)
Share and Enjoy.

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Streaming mjpg from Raspberry Cam

Mon May 01, 2017 3:49 pm

Guys,
While I think about it I'm having problems with streamer in file: "httpd.c:command(...

It appears that the original author declares two string pointers, uses them to define positions through the command parameter line and finally uses "free(command)" to dispose of them see:

Code: Select all

 
char *command = NULL, *svalue = NULL, ...

<snip>

  /* convert the command to id */
    command_id_string = command;
    len = strspn(command_id_string, "-1234567890");
    if((svalue = strndup(command_id_string, len)) == NULL) {
        if(command != NULL) free(command);
        send_error(fd, 500, "could not allocate memory");
        LOG("could not allocate memory\n");
        return;
    }

<and at the end...>
    if(command != NULL) free(command);
    if(svalue != NULL) free(svalue);


without any previous call to malloc(..) or similar.

So, during my time getting my head around how it all worked allowing the "free" functions to be called caused streamer to barf. It seems to run quite happily if I comment out all these "free" calls. Still haven't found where any memory gets allocated to either "*command" or "*svalue". The fact that these pointers are routinely modified through the function makes freeing any memory hanging off them a bit dangerous.

What am I missing?
Share and Enjoy.

RaspISteve
Posts: 98
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Streaming mjpg from Raspberry Cam

Mon May 01, 2017 6:28 pm

JoseTMR wrote:I am in desperate need of assistance. I am trying to change the port for mjpg-streamer to 8090 as the default 8080 is used by another pi on the same network. I have followed several tutorials I have found and have made no progress. I was able to change the listening port using haproxy for the Pi but that is as far as I have gotten. Any assistance would be GREATLY appreciated !!
Jose,
Further to my reply above which actually changes the default listening port you can simply add "-p <your_port_number>" to the particular output method you've defined on the command line that launches mjpg_streamer.

Go look in the "start.sh" file, find the active line you are using and add the "-p" parameter inside the quotes.

Code: Select all

./mjpg_streamer -o "output_http.so -w ./www -p 8090" -i "input_raspicam.so ..."
Share and Enjoy.

i-make-robots
Posts: 10
Joined: Mon Jun 24, 2013 2:40 am

Re: Streaming mjpg from Raspberry Cam

Mon Nov 06, 2017 9:50 pm

Hi! I'm late to the party.

I have my picam mounted on a robot that lets Twitch solve a jigsaw puzzle. There is a 3s delay between my Raspi B+ mjpeg_streamer and my LAN PC's copy of VLC, which is then scraped by OBS Studio to send to Twitch. Currently I start the mjpeg_streamer with

Code: Select all

mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -n -r 640x480 -q 95 -f 12 -hf -l auto" -o  "/usr/lib/output_http.so -p 12345 -w /usr/local/www" &
Please: What would you suggest to reduce this lag?

12oclocker
Posts: 39
Joined: Mon Oct 07, 2013 9:55 pm

Re: Streaming mjpg from Raspberry Cam

Mon Nov 06, 2017 11:35 pm

I am currently writting a v4l2 application that does >30fps hd streaming, and still shots, and disk saves, and motion detection, all simultaneously and supporting different frame rates for each, motion detect is done on the compressed jpeg without decompressing it which drastically reduces cpu usage. Motion masking is also avaliable to mask regions to ignore motion in. Everything is working and will be completed soon, everything works at only 2% cpu usage on a raspberry pi 2b+. Program is written in c++ and is multithreaded. It has no lag. I will post when it is completed.

Sancho
Posts: 10
Joined: Sun Nov 13, 2011 8:32 am

Re: Streaming mjpg from Raspberry Cam

Fri Mar 23, 2018 11:47 pm

Not sure this is the right place to ask the question, but I'll try.

I'd like to control the camera aspects (like exposure compensation, etc.) while streaming.
The original mjpg_streamer has a "control window" option where one can do some control with v4l2 and specific cameras with ability to change position.
Is there some controls of the raspicam settings exposed using HTTP interface?

RobLewis
Posts: 10
Joined: Wed Oct 17, 2018 10:36 pm

Re: Streaming mjpg from Raspberry Cam

Mon Dec 10, 2018 8:04 pm

I have mjpg_streamer working to display webcam video on a web page, using the input_uvc and output_http plugins.
I'd like to simultaneously record the video to a file on the Pi. Is there a way to do this?

holgerble
Posts: 44
Joined: Wed Mar 23, 2016 4:15 pm

Re: Streaming mjpg from Raspberry Cam

Mon Jan 07, 2019 3:34 pm

During compilation I always get this mistake ??

/home/pi/mjpg-streamer/mjpg-streamer-experimental/plugins/input_opencv/input_opencv.cpp:86:5: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
" Help for input plugin..: "INPUT_PLUGIN_NAME"\n" \

I took the newest version and are on newest stretch

best regards
Holger

MarcSallent
Posts: 8
Joined: Wed Dec 31, 2014 3:32 pm

Re: Streaming mjpg from Raspberry Cam

Wed Feb 13, 2019 9:10 am

I was missing the -fli (flicker avoid) parameter in the jacksonliam/mjpg-streamer repo for a project I'm doing, so I cloned it and added it here

https://github.com/MarcSallent/mjpg-streamer

It works exactly the same, you can just use that parameter

(posted it here for the next guy desperately looking for it. If/when my pull request to the original repo is accepted, I'll remove this post)

DaveEvansAK
Posts: 1
Joined: Wed Apr 03, 2019 1:10 am

Re: Streaming mjpg from Raspberry Cam

Wed Apr 03, 2019 1:21 am

jacksonliam wrote:
Fri Aug 05, 2016 10:26 pm
I have added the timestamp option to the raspicam input plugin to fetch and attach the timestamp to every frame, which sets the X-Timestamp header if you use output_http. Use it like so:

Code: Select all

./mjpg_streamer -i "input_raspicam.so -x 1280 -y 720 -timestamp" -o "output_http.so -w ./www"
As noted here https://github.com/jacksonliam/mjpg-streamer/issues/188, I (and others) would like a way for a timestamp to show up on snapshots and in a stream (as overlaid/annotation text).

Lacking that, is there a way to extract every X-Timestamp in the http header and display them on a web page, to create a timestamp adjacent to the snapshot or streaming image? The googling I've done seems to indicate that it is not possible. If it is possible, I would appreciate some hints.

ThijsDeschildre
Posts: 4
Joined: Thu Sep 27, 2012 11:35 pm

Re: Streaming mjpg from Raspberry Cam

Fri Jul 19, 2019 9:53 am

I'm trying to tweak the mjpg settings on OctoPrint. It uses mjpg-streamer, but it doesn't accept any changes. Whenever I change a setting or the resolution in the Octoprint config, the webcam function just breaks.
I see mjpg_streamer running with the parameters, kill it and try running the command myself...

Code: Select all

  ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
 ./mjpg_streamer: invalid option -- 'w'
-----------------------------------------------------------------------
Usage: ./mjpg_streamer
  -i | --input "<input-plugin.so> [parameters]"
  -o | --output "<output-plugin.so> [parameters]"
 [-h | --help ]........: display this help
 [-v | --version ].....: display version information
 [-b | --background]...: fork to the background, daemon mode
yes, I've set "export LD_LIBRARY_PATH=.".

my directory looks like this

Code: Select all

[email protected]:~/mjpg-streamer $ ls
_build          docker-start.sh    input_uvc.so  mjpg_streamer               [email protected]  output_udp.so   scripts   utils.h
cmake           input_file.so      LICENSE       mjpg_streamer.c             output_file.so          plugins         start.sh  www
CMakeLists.txt  input_http.so      makedeb.sh    mjpg-streamer-experimental  output_http.so          postinstall.sh  TODO      www-octopi
Dockerfile      input_raspicam.so  Makefile      mjpg_streamer.h             output_rtsp.so          README.md       utils.c
When I check the webcam log, with default parameters, I see:

Code: Select all

Running ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 821c330ea6bbb5fbed98d48e00aac156e923161b
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 10
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
I'm completely stuck on this. Already spent a lot of time on it. The Octoprint forum doesn't offer any help, besides one person who said he has exactly the same problem.
Is there some library that's still not included? Are they running a different fork?

User avatar
ntn
Posts: 3
Joined: Sun Mar 12, 2017 1:59 pm
Location: Orava

Re: Streaming mjpg from Raspberry Cam

Sat Aug 31, 2019 10:07 pm

I have troubles since some updates. Basically during night I get big amount of "ping noise" from every cam I have, which messes up the detection alot and is not something I want. Any ideas what was updates and what needs to be done?

I did a separate thread for this with more info, if anyone is interested: https://www.raspberrypi.org/forums/view ... &p=1526090
[ntn]
Pi 3B & HAT, Pi 3B+ & NoIR, Pi 3A+ & NoIR, PiZeroW

User avatar
HermannSW
Posts: 1569
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Streaming mjpg from Raspberry Cam

Mon Sep 02, 2019 11:13 am

ntn wrote:
Sat Aug 31, 2019 10:07 pm
Basically during night I get big amount of "ping noise" from every cam I have,
I assume you mean pink, and because of night I assume you have NoIR cameras.

Please read pinned thread "New AWB algorithm - NoIR camera support":
https://www.raspberrypi.org/forums/view ... 3&t=245994
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

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

Re: Streaming mjpg from Raspberry Cam

Thu Oct 17, 2019 10:57 am

Its not really related to raspberry cam, but sourceforge-mjpeg streamer links for help to jacksonliam and jacksonliam links for help into this forum.
I switched to Jessie 4.9.35-v7+ (yes i know dont touch a more or less running system cause ppl make new bugs into linux).
Before mjpeg-streamer works perfect 24/7 without any errors over years.
Now with this kernel it sends 0-2 times/day a HTTP answer with 2 images and the Content-length for both images together. The Viewing Software dont support this.
And i think this is not in the specs, its a Content-length for image/jpeg not for image/jpegs. There is only one Content-length in the file and only 1 --boundarydonotcross.

uharband
Posts: 1
Joined: Thu Oct 03, 2019 6:51 pm

Re: Streaming mjpg from Raspberry Cam

Mon Oct 21, 2019 6:46 pm

I use mjpg-streamer to stream over http with output_http plugin. When i want to save a mjpg video clip i use output_file plugin.
now, I can activate both output plugins at once to stream and save to file.
what i need though is the ability to start/stop capturing to video while http streaming is in progress.
the use case: video is streamed on going to http. at a certain point i want to start saving a video clip, e.g. user sends a 'start capture' request and then, after a period of time stop the recording. i don't see a way to activate/deactivate a plugin at runtime
Thanks!

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

Re: Streaming mjpg from Raspberry Cam

Mon Oct 28, 2019 12:37 pm

uharband wrote:
Mon Oct 21, 2019 6:46 pm
. at a certain point i want to start saving a video clip, e.g. user sends a 'start capture' request and then, after a period of time stop the recording. i don't see a way to activate/deactivate a plugin at runtime
You can access the HTTP stream of mjpeg-streamer not only with 1 computer at a time. With other words the simplest way is to run a program that waits for yor request an grab it from the HTTP stream(thats works too for localhost). Its alot data you can include encoding into the program.
Possible too with using of the ffmpeg+omx, but its not always stable seems that raspbian fragments the gpumem or has a memory leak so this can crash after some month.

Return to “Camera board”