Skip to content

Instantly share code, notes, and snippets.

@ivarprudnikov
Created October 10, 2014 00:01
Show Gist options
  • Save ivarprudnikov/ae2bbaaae80aa60a1eb2 to your computer and use it in GitHub Desktop.
Save ivarprudnikov/ae2bbaaae80aa60a1eb2 to your computer and use it in GitHub Desktop.
Streaming MxPEG from Mobotix IP camera via VLC
// hepful links
https://wiki.videolan.org/MxPEG/
http://stackoverflow.com/questions/1735933/streaming-via-rtsp-or-rtp-in-html5
http://en.wikipedia.org/wiki/Internet_media_type
http://www.videolan.org/doc/videolan-howto/en/ch09.html
http://www.videolan.org/doc/streaming-howto/en/ch03.html
http://www.mobotix.com/eng_GB/Support/User-Forum/Applications/Putting-Mobotix-live-video-stream-on-a-Web-site-How-To
http://www.linuxquestions.org/questions/linux-desktop-74/how-to-stream-a-webcam-to-http-with-vlc-929319/
// run ubuntu via docker
//////////////////////////
boot2docker up
$(boot2docker shellinit)
docker run -p 8080:8080 -t -i ubuntu /bin/bash
// run on ubuntu
//////////////////////
apt-get update
apt-get install vlc browser-plugin-vlc libav-tools
useradd user
// then run one from following commands:
>>>>> FLV with duplicate stream
sudo -u user vlc-wrapper --ffmpeg-format=mxg -vvv "http://username:password@cameraip:port/cgi-bin/faststream.jpg?stream=full" --sout '#transcode{vcodec=FLV1,vb=800,ab=32,fps=16,width=640,height=480,acodec=none}:duplicate{dst=std{access=http{mime=video/x-flv},mux=ffmpeg{mux=flv},dst=:8080/stream.flv},dst=display}'
>>>>> mpg via duplicate stream
sudo -u user vlc-wrapper --avformat-format=mxg -vvv "http://username:password@cameraip:port/cgi-bin/faststream.jpg?stream=MxPEG" --sout '#transcode{vcodec=mp4v,vb=800,ab=32,fps=16,width=640,height=480,acodec=none}:duplicate{dst=std{access=http{mime=video/mpeg},mux=ts,dst=:8080/stream.mpg},dst=display}'
>>>>> mpg single stream
sudo -u user vlc-wrapper --avformat-format=mxg -vvv "http://username:password@cameraip:port/cgi-bin/faststream.jpg?stream=MxPEG" --sout '#transcode{vcodec=mp4v,vb=800,ab=32,fps=16,width=640,height=480,acodec=none}:standard{access=http{mime=video/mpeg},mux=ts,dst=:8080/stream.mpg}'
>>>>> OGG
sudo -u user vlc-wrapper --avformat-format=mxg -vvv "http://username:password@cameraip:port/cgi-bin/faststream.jpg?stream=full" --sout '#transcode{vcodec=theo,vb=800,scale=1,width=640,height=480,acodec=none}:standard{access=http{mime=video/ogg},mux=ogg,dst=:8080/stream.ogg}'
// open stream url:
// $(boot2docker ip 2>/dev/null) gives ip of instance which is running docker
open http://$(boot2docker ip 2>/dev/null):8080/stream.ogg
@clemMM26
Copy link

Hi,
Thank you for the command line.
Do you have an example for a streaming "mjpeg" only ?
Change --ffmpeg-format=mjpeg - --avformat-format=mjpeg
this is correct ?
Thank
Clem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment