Open Video Workbook

Resources: Streaming

Most of the time streaming with VLC will be the easiest way to quickly get a feed from a webcam or a file up and available. Sometimes however, there will be situations where you will need more flexible tools. In this section we will give a few short examples from a selection of other available tools. We will start with the Liquidsoap software from Savonet and add more including CVLC, Gstreamer and oggfwd

Liquidsoap

http://savonet.sourceforge.net

Liquidsoap is powerful and flexible language for managing streams. Initially it was used for creating sophisticated web-radio streams it now has the ability to stream video. Expanding on the paradigms of radio, the creations of webtv becomes easy using the integrated playlst, scheduling and compositing tools.
It can use Gstreamer as the video back-end so all the tools and codecs available there also become available to liquidsoap, the Frei0r plugins are also available for applying video effects and there are native tools for compositing logos and scrolling news ticker style text. It also has the capability to receive Open Sound Control (OSC) messages so integration with hard and software controllers becomes possible.

A simple script written to encode, loop and stream a video file to an ogg theora mountpoint on an Icecast server as looks like this:

#############################

# Define a video file to stream:

source = single(“video.avi”)

# Adding some scrolling text:

source = video.add_text.sdl(
font="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf”, “Hello world!”, source)

# and a logo:

source = video.add_image(
width=30,height=30,
x=10,y=10,
file="logo.jpg”,
source)

# then stream the result to an icecast server:

output.icecast(
%ogg(%theora(quality=25,width=320,height=240),%vorbis),
host="localhost”,
port=8000,
password="hackme”,
mount="/videostream”,
source)

#############################

The above code can be saved in a file called video.liq and then run by typing liquidsoap video.liq

More comprehensive documentation showing off the more possibilities can be found here: http://savonet.sourceforge.net/doc-svn/video.html