wire.less.dk

wireless networking, free software, solar power

Free low tech video serving

Posted on | February 10, 2011 | No Comments

Notes on open source low cost video streaming
The requirements are:
* free open source solution
* no budget
* low bandwidth
* absolutely NO hosted solution, no centralized components
(in other words – no skype, no youtube, no “your hosted service”)
* live and archive
Open Source streaming options
VLC
icecast
Mediatomb
Kaltura (hosted, but available as self-hosted system)
MythTV
Red5
Read more:
http://klaus.geekserver.net/flash/streaming.html
http://openvideoalliance.org/wiki/index.php?title=List_of_Open_Source_Video_Software
We try out VLC from standard small laptop.
================================================
VLC
================================================
Before you begin:
Read:
=============================
MOST IMPORTANT:
http://wiki.videolan.org/Documentation:Streaming_HowTo
MORE DISCUSSION OF DETAILS
http://forum.videolan.org/viewtopic.php?f=4&t=84990
http://en.flossmanuals.net/TheoraCookbook/VLCEncoding
http://forum.videolan.org/viewtopic.php?t=32562
http://wiki.videolan.org/Documentation:Modules/v4l2
low bandwidth streaming:
http://forum.videolan.org/viewtopic.php?f=4&t=85932
Required
==================
Our system is:
Ubuntu Linux 10.04
USB Video cam
apt-get install vlc vlx-nox vlc-data libvlc-dev libvlc2 libvlccore-dev libvlccore2
(there might be more i forget here … follow dependencies)
From here on, it s the linux command line:
Identify webcam by doing
# ls /dev/video*
Plug and unplug until you find it.
In my case, it is
/dev/video0
then try
# vlc v4l2:///dev/video0
you should see the webcam streamed in your local vlc.
OK? …………..
yes
then try the stream & transcoding, with display at the same time:
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=44100}:display”
THIS example WORKS FOR ME
now try stream it to the network:
In the follwing examples,
my machine is 192.168.0.3
the clients are 192.168.0.x
Now, basically you have to play with the parameters –
read
http://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples
try everything, and test the results from your client machine
with
vlc -vvv http://192.168.0.3:8080
or by opening stream via GUI client.
What you are doing here is
tetsing for best mux, encoding, size, rates, and so forth.
My best result was
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=12,scale=1.0,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”
and here is all the other ones i tried. 🙂
===============================================
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=44100}: standard{access=http,mux=ogg,dst=192.168.0.3:8080}”
SUCCESS!!
finetuning:
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=64,channels=2,samplerate=44100}: standard{access=http,mux=ogg,dst=192.168.0.3:8080}”
SUCCESS!!
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=64,channels=2,samplerate=44100}: standard{access=http,mux=ogg,dst=192.168.0.3:8080}”
does the double speed thingie!
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=mp2v,vb=1024,scale=1,acodec=vorb,ab=64,channels=2,samplerate=44100}: standard{access=http,mux=ogg,dst=192.168.0.3:8080}”
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=650,fps=24,scale=0.5,acodec=mp3,ab=90,channels=1,samplerate=44100}:duplicate{dst=http{mux=ts,dst=192.168.0.3:8080},dst=display} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep”
dont work
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=650,fps=24,scale=0.5,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ogg,dst=192.168.0.3:8080}”
YES!!! BEST SO FAR!
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=650,fps=24,scale=0.5,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”
WORKS fine too
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=4,scale=0.5,acodec=mpeg,ab=192,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”
WORKS
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio” :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=12,scale=1.0,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”
WORKS
vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=12,scale=1.0,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”
WORKS WELL
===========================================================================================
how to find pulseaudio device
pactl list | grep -A2 ‘Source #’ | grep ‘Name: ‘ | cut -d” ” -f2
gives me
alsa_input.usb-046d_0992_D09F8DDF-02-U0x46d0x992.analog-mono

Notes on open source low cost video streaming

In what follows, we are looking at video streaming solutions for rural networks with limited uplink bandwidths and limited budgets. The requirements are:

  • free open source solution
  • no budget for additional hardware or network (…)
  • low bandwidth for video streams
  • absolutely NO hosted solution, no centralized components (in other words – no skype, no youtube, no – not even “your favorite hosted service”)
  • streaming live as well as from archive files
low tech stream bangkok

low tech stream bangkok

Some Open Source streaming options

  • VLC
  • icecast
  • Mediatomb
  • Kaltura (hosted, but available as self-hosted system)
  • MythTV
  • Red5

Read more:

http://klaus.geekserver.net/flash/streaming.html

http://openvideoalliance.org/wiki/index.php?title=List_of_Open_Source_Video_Software

In what follows, we will work with VLC streaming from a standard small laptop.

VLC

Before you begin, Read:

MOST IMPORTANT:

http://wiki.videolan.org/Documentation:Streaming_HowTo

MORE DISCUSSION OF DETAILS

http://forum.videolan.org/viewtopic.php?f=4&t=84990

http://en.flossmanuals.net/TheoraCookbook/VLCEncoding

http://forum.videolan.org/viewtopic.php?t=32562

http://wiki.videolan.org/Documentation:Modules/v4l2

low bandwidth streaming:

http://forum.videolan.org/viewtopic.php?f=4&t=85932

Requirements

Our system is:

Ubuntu Linux 10.04

USB Video cam

Install packages as follows, from command line (or alternatively via synaptics GUI):

# apt-get install vlc vlc-nox vlc-data libvlc-dev libvlc2 libvlccore-dev libvlccore2

(there might be more i forget here … follow dependencies as suggested by package manager)

From here on, it s the linux command line:

Identify webcam by doing

# ls /dev/video*

Plug and unplug until you find it.

In my case, it is

/dev/video0

then try

# vlc v4l2:///dev/video0

you should see the webcam streamed in your local vlc.

If this is working, try streaming and transcoding, with display at the same time:

vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=640 :v4l-height=480 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout “#transcode{vcodec=theo,vb=800,scale=1,acodec=vorb,ab=128,channels=2,samplerate=44100}:display”

This example works for me – note that your device names and detail settings might be different.

Next, try stream it to the network:

In the follwing examples,

my machine is 192.168.0.3

the clients are 192.168.0.x

On a client, you can test your stream from the server by doing

vlc -vvv http://192.168.0.3:8080

or by opening stream via GUI client.

My best result was achieved with the following settings for the server’s stream:

vlc v4l2:// :v4l-vdev=”/dev/video0″ :v4l-adev=”/dev/audio1″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=12,scale=1.0,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.3:8080}”

The one problem with that line was sound – which didnt work yet.

Great help from the videolan forum, thanks!  https://forum.videolan.org/viewtopic.php?f=4&t=87529&e=0&sid=424a9bacd39a0d3650777aef87699c7f

“Looking at the input string with the “Show More Options” box checked in the GUI will display your default audio input like…

vlc v4l2:// :input-slave=alsa:// :v4l2-standard=0 ”

That worked for me, so the command becomes:

vlc v4l2:// :input-slave=alsa:// :v4l-vdev=”/dev/video0″ :v4l-norm=3 :v4l-frequency=-1 :v4l-caching=300 :v4l-chroma=”” :v4l-fps=-1.000000 :v4l-samplerate=44100 :v4l-channel=0 :v4l-tuner=-1 :v4l-audio=-1 :v4l-stereo :v4l-width=480 :v4l-height=360 :v4l-brightness=-1 :v4l-colour=-1 :v4l-hue=-1 :v4l-contrast=-1 :no-v4l-mjpeg :v4l-decimation=1 :v4l-quality=100 –sout=”#transcode{vcodec=mp4v,vb=800,fps=12,scale=1.0,acodec=mp3,ab=90,channels=1,samplerate=44100}:standard{access=http,mux=ts,dst=192.168.0.4:8080}”

In order to find the best settings (size, bandwidth, encoding, mux, etc)  you have to play with the parameters –

read

http://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples

and play with different settings.

how to find pulseaudio device on a Ubuntu 10.04

pactl list | grep -A2 ‘Source #’ | grep ‘Name: ‘ | cut -d” ” -f2

gives me

alsa_input.usb-046d_0992_D09F8DDF-02-U0x46d0x992.analog-mono

Comments

Leave a Reply