Squirrelthroat
Posts: 1
Joined: Wed Jan 07, 2015 1:11 am

Using mjpg-streamer to setup a livestream

Wed Jan 07, 2015 1:37 am

Hey,

this is my first topic and sadly about a project many already described and explained extensively.
After my first few steps i reached an obstacle i was unable to get over by myself, neither did anything i found in the web help me.

I already made the following steps:
- Installed the librarys mjpg-streamer uses: libjpeg8-dev imagemagick libv4l-dev
- Downloaded MJPG-Streamer
- Built MJPG-Streamer with the needed plugins using

Code: Select all

make mjpg_streamer input_file.so output_http.so
- Copied the libraries to appropriate places using

Code: Select all

$ sudo cp mjpg_streamer /usr/local/bin
$ sudo cp output_http.so input_file.so /usr/local/lib/
$ sudo cp -R www /usr/local/www
- Started the camera using

Code: Select all

$ raspistill --nopreview -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 &
and that worked fine

After that i tried to finally start MJPG-Streamer
The following methods result in the same error message:

Code: Select all

LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www"

Code: Select all

mjpg_streamer -i "/usr/local/lib/input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www"

Code: Select all

export LD_LIBRARY_PATH=/usr/local/lib/
mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www"[/
Given error:

Code: Select all

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

The plugin files "output_http.so" and "input_http.so" are placed in /usr/local/lib
What am i missing?

I hope that this is not off-topic, in the wrong section or too stupid to ask.
Thanks in advance

Mr_Bra
Posts: 2
Joined: Tue Oct 21, 2014 5:48 am

Re: Using mjpg-streamer to setup a livestream

Sun Jan 11, 2015 8:45 am

maybe you can try this,I cannot promise the result
mjpg_streamer -i "/usr/local/lib/input_file.so -f /tmp/stream -n pic.jpg" -o "/usr/local/lib/output_http.so -w /usr/local/www"


After all there is no error in my app.
I can only see static image in web,but I cannot get stream.

danjperron
Posts: 3890
Joined: Thu Dec 27, 2012 4:05 am
Location: Québec, Canada

Re: Using mjpg-streamer to setup a livestream

Sun Jan 11, 2015 2:03 pm

Just wonder ?

What is wrong with the standard make install.


I always install mjpg_stream this way for external web cam and I just check with the Raspberry Camera and works fine.

Code: Select all

sudo apt-get install subversion libjpeg8-dev \
imagemagick libv4l-0 libv4l-dev
cd ~
svn co https://svn.code.sf.net/p/mjpg-streamer/code mjpg-streamer
cd mjpg-streamer/mjpg-streamer
make USE_LIBV4L2=true clean all
sudo make install
I also create a ramdrive for /tmp . Just don't want to damage the SD card.

modify /etc/fstab 'sudo nano /etc/fstab and add this line

Code: Select all

tmpfs		/tmp		tmpfs	defaults,noatime,mode=1777 0 0
create your folder /tmp/stream. You should put a command in /etc/rc.local to always create that folder since it will be erase everytime you reboot.

and I start raspistill

Code: Select all

pi@PiPlus ~ $ raspistill --nopreview -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 999999 -th 0:0:0 &
and start my script streamer.sh from folder /usr/local/bin

Code: Select all

pi@PiPlus ~ $ cat /usr/local/bin/streamer.sh
#!/bin/sh
/usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_file.so -f /tmp/stream -n pic.jpg"  -o "/usr/local/lib/output_http.so -p 10088 -w /usr/local/www" &
It is working fine.

Daniel

Return to “General programming discussion”