Hi guys! A lot of information about streaming with raspberry pi. But no information about PLAYING mjpeg, h264 stream!
Is it possible? Im trying in firefox (iceweasel) but its no use slowwww..
My idea: use raspberry to convert mjpeg stream from camera to DVR (rca out).
Its a simply: one cam, one stream, one play stream to rca video out.
How to play mjpeg stream(link example: http://tra-lalaa=stream&main) on raspberry pi with GPU accelerated?
Thanks.
Raspberry PI MJPEG stream to RCA (playing mjpeg stream!)
22 posts
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
vlc can play a stream. direct from the source too !
e.g /dev/video0
don't know about speed though
e.g /dev/video0
don't know about speed though
My Blog - http://www.sirlagz.net
Visit my blog for ffmpeg Webcam streaming, Raspbian Server Edition, RaspAP Hotspot guides and more !
Home of PiParted - A custom GParted LiveCD to make installing OSes onto the SD Card easier !!
Visit my blog for ffmpeg Webcam streaming, Raspbian Server Edition, RaspAP Hotspot guides and more !
Home of PiParted - A custom GParted LiveCD to make installing OSes onto the SD Card easier !!
- Posts: 956
- Joined: Mon Feb 20, 2012 8:53 am
- Location: Perth, Australia
No. /dev/video0 - is wrong.
Camera streaming from lan.
NO Usb camera directly attached to raspberry pi!
I have trying do this with VLC. Its working! But 0-1 fps in one minute! Its awesome slowwww!
Camera streaming from lan.
NO Usb camera directly attached to raspberry pi!
I have trying do this with VLC. Its working! But 0-1 fps in one minute! Its awesome slowwww!
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
You can try omxplayer , but MJPEG is one of the many
unaccelerated codecs (currently) ... AFAIK.
ghans
unaccelerated codecs (currently) ... AFAIK.
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
http://www.cnx-software.com/tag/omxplayer/ - guy in this page written experimental method to plaing mjpeg files on omxplayer with mjpeg encoding.
Its works! Very fast work!
But on localy storage files.(via sdcard: sdb1/home/tra-la-la.MOV)
How Omxplayer get stream from web? Example: "omxplayer -o hdmi http://some IP/stream&mjpeg=main" - as browser? Is it possible?
Its works! Very fast work!
But on localy storage files.(via sdcard: sdb1/home/tra-la-la.MOV)
How Omxplayer get stream from web? Example: "omxplayer -o hdmi http://some IP/stream&mjpeg=main" - as browser? Is it possible?
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Use mplayer to dump it to a named pipe , and
have omxplayer read from that.
Very neat find BTW , i wasn't aware of those experimental
omxplayer features.
ghans
have omxplayer read from that.
Very neat find BTW , i wasn't aware of those experimental
omxplayer features.
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
Use mplayer to dump it to a named pipe , and
have omxplayer read from that. - please take me more detail. Im noob.
have omxplayer read from that. - please take me more detail. Im noob.
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
sudo mplayer -dumpvideo rtsp://ipnumber/stream -dumpfile /home/pi/stream1.mkv
No rtsp stream.. Im tell about simply http stream. A lot of camera make this simply stream, and have a link Example: http://213.110.198.66:555/aV6NQZzB?cont ... tream=main
How this to play? (Not in browser! Is not usable, very slow on PI)
No rtsp stream.. Im tell about simply http stream. A lot of camera make this simply stream, and have a link Example: http://213.110.198.66:555/aV6NQZzB?cont ... tream=main
How this to play? (Not in browser! Is not usable, very slow on PI)
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Try this :
ghans
- Code: Select all
mkfifo /tmp/streampipe
mplayer http://www.example.com/path?container=mjpeg&stream=main -dumpstream -dumpfile /tmp/streampipe 1>null 2>null &
omxplayer -r /tmp/streampipe
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
mplayer http://www.example.com/path?container=mjpeg&stream=main -dumpstream -dumpfile /tmp/streampipe 1>null 2>null &
System answer:
mplayer: could not connect to socket
mplayer: No such file or directory
System answer:
mplayer: could not connect to socket
mplayer: No such file or directory
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Try this instead :
I gave an example URL , you had to subsitute it for a real one !
ghans
- Code: Select all
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg http://213.110.198.66:555/aV6NQZzB?container=mjpeg&stream=main
omxplayer -r /tmp/stream.mjpeg
I gave an example URL , you had to subsitute it for a real one !
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
Did you execute all the commands i posted exactly
the same way ?
yes of course!
The mplayer url is a example URL ,
you have to subsitute it for a real one !
Im reading and undestand code. Also im undestand what im do. Im used working link, check before link in firefox browser on PC x86, after that im tested this link on raspberry pi..
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg http://213.110.198.66:555/aV6NQZzB?cont ... tream=main
omxplayer -r /tmp/stream.mjpeg
Genius!
But not work.
Wget start non stop downloading to file, but omxplayer cant view content of file..
Wait a minute! Idea!.
the same way ?
yes of course!
The mplayer url is a example URL ,
you have to subsitute it for a real one !
Im reading and undestand code. Also im undestand what im do. Im used working link, check before link in firefox browser on PC x86, after that im tested this link on raspberry pi..
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg http://213.110.198.66:555/aV6NQZzB?cont ... tream=main
omxplayer -r /tmp/stream.mjpeg
Genius!
But not work.
Wget start non stop downloading to file, but omxplayer cant view content of file..
Wait a minute! Idea!.
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
ghans, this is great! Your last idea is WORKED!
Im see mjpeg stream from omxplayer!
Thank you very match!
But, Wget non-stop downloading file, and file in tmp has become bigger and bigger. How resolve this? Any idea?
P.S. Im so stupid!
Add &> /dev/null & - tadam! File in tmp = 0 kb ever! GREAT WORK! THANK YOU!
P.P.S. Guys! Who read this post for resolve mjpeg stream view. This http://www.cnx-software.com/tag/omxplayer/ - needed. Without this omxplayer dont undestand mjpeg stream!
Im see mjpeg stream from omxplayer!
Thank you very match!
But, Wget non-stop downloading file, and file in tmp has become bigger and bigger. How resolve this? Any idea?
P.S. Im so stupid!
Add &> /dev/null & - tadam! File in tmp = 0 kb ever! GREAT WORK! THANK YOU!
P.P.S. Guys! Who read this post for resolve mjpeg stream view. This http://www.cnx-software.com/tag/omxplayer/ - needed. Without this omxplayer dont undestand mjpeg stream!
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Total, step-by-step to view mjpeg stream.
Do this (here is detailed: http://www.cnx-software.com/tag/omxplayer/):
wget https://github.com/Hexxeh/rpi-update/ra ... rpi-update
chmod 755 rpi-update
sudo ./rpi-update
Add the following two lines to /boot/config.txt:
start_file=start_x.elf
fixup_file=fixup_x.elf
Install precompilled omxplayer with mjpeg support:
cd /
tar xzvf omxplayer-dist.tar.gz
cd omxplayer-dist
sudo cp * / -rf
Distr link: http://ubuntuone.com/77X6Mr23tdS2orm16tbzj4
Make this:
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg 'http://213.110.198.66:555/aV6NQZzB?container=mjpeg&stream=main' &> /dev/null &
omxplayer -r /tmp/stream.mjpeg
Go!
Im add in system autostart script. After im switch on raspberry last strings make automatics.
cd home
nano start_stream.sh
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg 'http://some_ip:some port/aV6NQZzB?container=mjpeg&stream=main' &> /dev/null &
omxplayer -r /tmp/stream.mjpeg
ctrl+O, ctrl+x
And put to rc.local
sh /home/start_stream.sh
Do this (here is detailed: http://www.cnx-software.com/tag/omxplayer/):
wget https://github.com/Hexxeh/rpi-update/ra ... rpi-update
chmod 755 rpi-update
sudo ./rpi-update
Add the following two lines to /boot/config.txt:
start_file=start_x.elf
fixup_file=fixup_x.elf
Install precompilled omxplayer with mjpeg support:
cd /
tar xzvf omxplayer-dist.tar.gz
cd omxplayer-dist
sudo cp * / -rf
Distr link: http://ubuntuone.com/77X6Mr23tdS2orm16tbzj4
Make this:
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg 'http://213.110.198.66:555/aV6NQZzB?container=mjpeg&stream=main' &> /dev/null &
omxplayer -r /tmp/stream.mjpeg
Go!
Im add in system autostart script. After im switch on raspberry last strings make automatics.
cd home
nano start_stream.sh
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg 'http://some_ip:some port/aV6NQZzB?container=mjpeg&stream=main' &> /dev/null &
omxplayer -r /tmp/stream.mjpeg
ctrl+O, ctrl+x
And put to rc.local
sh /home/start_stream.sh
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Xapepam wrote:Total, step-by-step to view mjpeg stream.
Couple of simplifications:
Xapepam wrote:Do this (here is detailed: http://www.cnx-software.com/tag/omxplayer/):
wget https://github.com/Hexxeh/rpi-update/ra ... rpi-update
chmod 755 rpi-update
sudo ./rpi-update
- Code: Select all
sudo apt-get update && sudo apt-get upgrade
has been updated recently, and gets firmware with MJPEG support
Xapepam wrote:Add the following two lines to /boot/config.txt:
start_file=start_x.elf
fixup_file=fixup_x.elf
while you need this for VP6/VP7/Theora, MPJEG support is included with default start.elf image.
Xapepam wrote:Install precompilled omxplayer with mjpeg support:
cd /
tar xzvf omxplayer-dist.tar.gz
cd omxplayer-dist
sudo cp * / -rf
Distr link: http://ubuntuone.com/77X6Mr23tdS2orm16tbzj4
The previous apt-get upgrade will have updated omxplayer to a version that supports MJPEG.
- Moderator
- Posts: 3227
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Dom, thank you. All variants worked, but your little shortest and rightest 
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
Guys, again Im with little problem.
One stupid question: If stream will work with cgi auth, how to get it?
Example 1: wget -O /tmp/stream.mjpeg 'http://213.110.198.66:555/aV6NQZzB?container=mjpeg&stream=main' - this link work well.
Example 2: wget -O /tmp/stream.mjpeg 'http://some_IP:some_port/cgi-bin/CGIProxy.fcgi?usr=username&pwd=password&cmd=GetMJStream ' - this will not work..
What command will help me in Example 2?
Thanks!
One stupid question: If stream will work with cgi auth, how to get it?
Example 1: wget -O /tmp/stream.mjpeg 'http://213.110.198.66:555/aV6NQZzB?container=mjpeg&stream=main' - this link work well.
Example 2: wget -O /tmp/stream.mjpeg 'http://some_IP:some_port/cgi-bin/CGIProxy.fcgi?usr=username&pwd=password&cmd=GetMJStream ' - this will not work..
What command will help me in Example 2?
Thanks!
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
That could be anything ... try changing the user-agent.
man wget should tell how.
Any googled Mozilla user-agent should work.
ghans
man wget should tell how.
Any googled Mozilla user-agent should work.
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
- Posts: 2615
- Joined: Mon Dec 12, 2011 8:30 pm
- Location: Germany
Im very noob 
But im finded solution:
curl -s -o /tmp/stream.mjpeg 'http://http://some_ip/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=username&pwd=password' &> /dev/null &
Works well! Thanks!
But im finded solution:
curl -s -o /tmp/stream.mjpeg 'http://http://some_ip/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=username&pwd=password' &> /dev/null &
Works well! Thanks!
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
I continue this subject..
Guys.
This works great,
but if the link isn't available to downloading any more - omxplayer totaly hangs. Screen is totaly freeze.
Im put this code to rc.local and autostart streaming every boot. But im dont know how restart streaming after link is up, without manual reboot. (If needed i agree to automatic reboot.)
I need automaticaly start stream after link is down some times without my promt or ssh coonect. Please help. Thanks!
P.S. Ok. Im use wget timeout and win in this battle. Thanks all!
Guys.
This works great,
- Code: Select all
mkfifo /tmp/stream.mjpeg
wget -O /tmp/stream.mjpeg 'http://[u]SOME_IP[/u]:555/aV6NQZzB?container=mjpeg&stream=main' &> /dev/null &
omxplayer -r /tmp/stream.mjpeg
but if the link isn't available to downloading any more - omxplayer totaly hangs. Screen is totaly freeze.
Im put this code to rc.local and autostart streaming every boot. But im dont know how restart streaming after link is up, without manual reboot. (If needed i agree to automatic reboot.)
I need automaticaly start stream after link is down some times without my promt or ssh coonect. Please help. Thanks!
P.S. Ok. Im use wget timeout and win in this battle. Thanks all!
- Posts: 14
- Joined: Tue Feb 12, 2013 6:15 am
omxplayer worked fine with mjpeg streaming from a network camera. Good performance in terms of images per second but I wonder why there is a 5 seconds lag? Is there some buffer that I should reduce?
Thanks.
Thanks.
- Posts: 1
- Joined: Sun May 12, 2013 7:40 pm