Projects

The LScube – Libre Streaming, Libre Software, Libre Standards (aka Open Media Streaming Project) is a free/libre project software for the development of a platform for the streaming of multimedia contents. The platform is based on the full support of the standard IETF for the real-time data transport over IP. The aim of the project is to provide an open solution, free and interoperable along with the proprietary streaming applications currently dominant on the market.

LScube is one of the research projects started by Angelo Raffaele Meo [mail] and Juan Carlos De Martin [mail|web] in the year 2000 within the Internet Media Group at the Politecnico di Torino/IEIIT-CNR.

The project has been managed by Giampaolo Mancini [mail|web] and Francesco Varano [mail|web] until 2007. Currently the group is led by Luca Barbato [mail|web], Dario Gallucci [mail|web] and Alessandro Molina [mail|web]

Currently the Project aims to create a complete RTSP streaming suite and toolkit and is composed by the following software:

Feng - the RTSP/RTP streaming server

Feng is a multimedia streaming server compliant with the IETF's standards for real-time streaming of multimedia contents over Internet. Feng implements RTSP – Real-Time Streaming Protocol (rfc2326) and RTP/RTCP – Real-Time Transport Protocol/RTP Control Protocol (rfc3550) supporting the RTP Profile for Audio and Video Conferences with Minimal Control (rfc3551).

Feng supports the following encoding standards:

The main characteristics of Feng are the container support, the ability to handle seeking, also used internally for the compositor metademuxer, and the modular structure focused to ease the extension of the codec and the protocol support.

Feng 2.1.0_rc1 is available, otherwise you may fetch the live sources from our public git tree

Feng is released under the GNU Lesser General Public License version 2.1

Dependencies

NOTE: the clients that are currently working out of box with Feng are VLC, Gstreamer, MPlayer. Currently only Gstreamer supports vorbis and theora playback, soon libnemesi will provide support for it.

Client compatibility list

  libnemesi Live555.com FFPlay GStreamer RealPlayer HelixPlayer QuickTime
General RTSP OK OK OK OK OK OK OK
Seek support Yes Partial1 No No Yes Yes Yes
Pause support Yes Partial1 Yes Yes Yes Yes Yes
General RTP/RTCP OK OK OK OK OK OK Partial2
MPEG Video 1/2 Yes Yes Yes Yes3 Partial4 No Yes
MPEG Audio Yes Yes Yes Yes Yes Yes Partial5
Vorbis Yes No No Yes No No No
Theora No No No Yes No No No
H.264 Yes Yes Yes Yes No No Yes
H.263/H.263+ Yes Yes Yes Yes Partial6 No Partial7
MPEG 4 Visual Yes Yes Yes Yes Partial4 No Yes
AAC Yes Yes Yes Yes Yes No Yes

(1) Live555 Seek and Pause implementation is not compliant with RFC 2326, so pause works only with seekable streams and seek may behave strangely or freeze the client.

(2) QuickTime does not support RTP/AVP/TCP interleaved but a proprietary form of rtsp tunnelling over http, so only UDP is supported

(3) Gstreamer fails to decode mpeg1/2 video when gst-ffmpeg is installed (it will be fixed in gst-plugins-good 0.10.7).

(4) Works on Windows and Mac only.

(5) MPEG Audio Layer-III (MP3) is not supported.

(6) H.263+ is not decoded correctly.

(7) Only standard resolutions (eg. CIF) seem to work.

Internals

Currently feng provides some sparse documentation about its internals you can generate documentation using doxygen from the git sources. The following text aims to give some additional high level insights about the structure before you dive into the doxy.

Feng structure

One of the main improvements over fenice is the modular design. Roughtly feng is splitted in its layers and in some functional modules. Each component will eventually provide some external hooks (e.g. rtcp feedbacks, scheduling behaviours) to enhance and experiment w/out having to dive in the full source.

Network layer: Socket management is implemented as a separated library called NetEmbryo. Feng is currently supporting UDP, TCP and SCTP

RTSP:

RTP:

RTCP:

Buffer management: The bufferpool system bridges the container parsing and packet producing modules to the delivery scheduler and then network layers. Through use of shared memory is possible use external helper applications like felix in order to have advanced features like distributed live streaming.

Mediathread: It encompass all the parsing and packetization activities beside rtp encapsulation. It could be split in two family of modules:

Parsers: provide facilities to packetize proper rtp payloads out of specific codec bitstreams.

Demuxers: read from traditional containers (like mkv, mov or nut) or more specific metademuxer like stream descriptions or editlists.

Authentication and Access

Other streaming servers support access and authentication in a quite complete and probably nice way. We could either try to come up with something similar (they tried to make it similar to apache way) or try to look at alternatives.

Methods

There are two metods defined, plain and digest. We should implement just plain and put it over tls, digest is a bit complex and tls should be better from a security point.

Access lists

There are various ways to describe who has access to what, usually you either create a list with paths and the users that have access to them, sometimes you define groups of users and then use them with the before mentioned lists, sometimes you put a list of users next to the content or even INSIDE the content you want to restrict/grant the access to. Since reinventing the wheel while there are others already around more or less rounder it's pointless, it's better try to consider what others did for their needs:

  • darwin and apache way [todo:describe it]
  • lighttpd way [todo:describe it]

Since we are aiming on the small and slick niche I think we could consider more and more the lighttpd way.

Initial underpinnings about auth are available already on gitweb

Live support

Planning

This page is just for planning.

What is live support

The idea is being able to stream a live event from a real time encoded stream. Sounds quite simple but has a series of caveats. You have different streams (video, audio, subs, metadata) that got produced by independent sources more than often and that must be pushed to the network as soon as possible. The fact that the sources are independent means that is our task give some timestamps to make things synchronous (e.g voice – lips or voice – text), seeking is not supported since it is a live event.

Resource details

Supporting live means that we have a resource that is particular:

  • Every client gets the same data, the data must not be consumed till the latest client gets it (bufferpool already does that)
  • The sdp remains the same across the different calls but the data used to produce it could be as long as gone when we receive later requests.
  • We need a way to present the multiple streams as a single resource (sd does that already)

Problems

  • How are we going to feed the stream to the server?
    • which format?
      • the streams must be elementary streams by definition
      • they are the output from an encoder (ffmpeg? vlc? gst?)
      • the best would be having them already packed in rtp
    • how to communicate?
      • name pipes?
      • sockets?
      • shared memory?
  • Do we need a specific demuxer?
    • Yes, possibly one that gets the sdp data and the rtp streams directly and just pushes them to the bufferpool with almost no work
    • No, we already have demuxer_sd that worked quite well in fenice even if it require lots of manual labour for h264.

Metademuxer

Metademuxers in short

A metademuxer act exactly as a standard demuxer, exposes the very same interface, but instead of reading from a file container it does any kind of manipulation over already mapped resources based on specific per resource configuration files.

Currently implemented

  • demuxer_ds : it simply collates a list of time referenced part of resources together. The resources MUST contain exactly the same kind of media (eg. same codecs, resolutions and parameters) and be seekable and the resulting resource is seekable too.

    Example configuration file

# Version 1 - free form text here
resource.mov 0.0 1.0
resource.ds 1.0 3.0
resource.nut 3.0 4.0

TODO: move the configuration to the unified yaml based configuration, use an uniform uri handler for them

  • demuxer_sd : it is basically the old fenice configuration file, it maps different live streams as a single resource.

Example configuration file

stream
    file_name mq:///video
    encoding_name MPV
stream_end
stream
    file_name mq:///audio
    encoding_name MPA
stream_end

Unified configuration syntax

Background

Fenice started with a simple and plain configuration file for the global settings and then another syntax was used for the stream description and in feng we had to add another for the compositions.

The overall results are the following:

  • we have three ugly hand made parsers for those syntaxes that had been almost fixed overall but remain pretty inflexible.
  • we'll need to have others once we need to express/expose other features to the end user.
  • users have to learn (and we have to document) many different syntax.

Abstract ideas

Main configuration

The main configuration must provide support for host and base virtuals, that means that the following structure should be presented: The main configuration will reside in a feng.conf file as was before, just the path would be $sysconfdir/feng/feng.conf and optionally additional sub configuration files (like module specific configurations) can stay in separate files and be included from the main feng.conf.

  • main
    • global settings
      • priviledges
        • user
        • group
      • max session
      • log tag
      • log file
    • addresses
      • address1
        • ports
          • tcp ports
          • sctp ports
          • name1
            • root paths
            • max session
            • log tag
            • log file
            • acl conf
    • module specific setting
      • module1
        • option1
    • include files/dir

It should allow (maybe in a second time) support for including additional configuration files (like the include directive present in many languages) and merge the informations.

Resource configuration

The resource configuration should provide demuxer specific settings and additional information useful for the stream. There is a group of settings that is common to every demuxer. The resource configurations will be in substitution of the current .sd and .ds files, it will have a magic string on the first line to let the demuxer layer know it is a resource configuration without relying on the extension to guess which kind of file it is. They will reside in the avroot tree, each file name and path will be used as resource identifier.

  • resource
    • aggregate
      • resource pointer stream_id
      • resource
        • …inline resource description
      • map
    • list
      • item
        • resource
        • time
          • start
          • stop
    • uri
    • metadata
      • name
      • author

      • cc tag
    • overrides
      • sdp specific settings

Implementation

The main idea is to use just a single syntax across the configurations. Resources, global settings, per path settings will share the same parser, that has to possibly be a robust library, we have limited resources and I'd rather spend our time implementing streaming features than minimalistic parsers while full featured, fast and complete ones are available already.

XML based syntax

Pros:

  • there are many stable and well known libraries
  • Many people know it already
  • there are tools around to validate the syntax given we create a schema/dtd for it.

Cons:

  • It could be quite complex to hand write.
  • Many people hate it

YAML based syntax

Pros:

  • It is widely available across many different languages
  • It is quite simple to compile by hand, yet as expressive as XML
  • Provides all the facilities XML offers

Cons:

  • there are just two C libraries available libyaml basically born as the core library for the python parser and syck again more focused on being used by other languages than being used directly.
  • The mentioned libs are quite robust for our usage but their release aren't frequent.

Flux - The RTP stream Manager and Mixer

Flux is an RTP stream manager. Is the son of Felix and it is used to manipulate RTP streams applying parsers over them to mix them, clone them, sync them, unpack them, scale them etc.

Flux takes for various inputs (like TCP, UDP, etc…) applyes to them a parser (like copy, live, transcode, scale, unpack, etc…) and writes the result to an output (like TCP, UDP, File, Bufferpool, etc…). This makes possible to use Flux for example to serve live streams from Feng or to replicate streams on two different Feng, to transcode and scale video stream, to mix multiple audio streams into one or to simply dump the content to a file to be able to play it later.

Libnemesi - the RTSP/RTP client library

Libnemesi let you add multimedia streaming playback in your applications in a quick and straightforward way. This software, derived from the experience matured with NeMeSi is fully compliant with IETF's standards for real-time streaming of multimedia contents over Internet. libnemesi implements RTSP – Real-Time Streaming Protocol (RFC2326) and RTP/RTCP – Real-Time Transport Protocol/RTP Control Protocol (RFC3550) supporting the RTP Profile for Audio and Video Conferences with Minimal Control (RFC3551).

The library provides two different API:

Libnemesi leverages the netembryo network support and provides hooks to register custom depacketizers (rtp parsers) to have a good compromises between ease of use and flexibility.

libnemesi hasn't been released yet, you can fetch it from our public git tree or use a snapshot

MPlayer has support for libnemesi and currently it is the main testbed for improvements.

libnemesi is released under the GNU Lesser General Public License version 2.1

Dependencies

Libnemesi internals

Libnemesi is implemented with several nested threads dispatched for every session. Within the main thread we send requests to the various servers identified by an RTSP Controller structure, then a thread is dispatched to handle responses.

  • First of all by calling rtsp_init we create an RTSP thread which handles incoming RTSP packets.
  • The RTSP thread as soon as it receives a valid SETUP response from the server creates two different threads to handle RTP and RTCP packets
  • The RTP thread as soon as its created initializes the various parsers for the session
  • Then all the threads will run handling the packets of their specific layer until the RTSP thread for the given session is terminated.

This is a brief documentation of the various layers involved in libnemesi

libnemesi Reference: Doxygenerated reference for libnemesi

RTSP Layer: How the RTSP layer in libnemesi works

RTP Layer: Quick description of the RTP layer in libnemesi

RTCP Layer: How libnemesi implements the RTCP protocol

SDP parser: Libnemesi implements a simple SDP parser for sessions. This is how it works

Theater - The Feng Web Interface and Content Manager

Theater is a Web Application able to list content served by Feng.

Theater associates metadata like author and title to multimedia files, autogenerates thumbnails for them and makes possible to play them from the web embedding the most common video players with support for RTSP/RTP protocols.

Theater also has a control panel to upload/remove media and to quickly configure the Feng server.

And example of Theater in action is on our server at TOP-IX

Bufferpool - the memory management library Feng and Felix depend upon

Bufferpool is a memory management library used in feng, libnemesi, felix. It provides a nice way to store rtp packets efficiently and share them across applications.

Bufferpool 0.0.4 is available, otherwise you may fetch the live sources from our public git tree

Bufferpool is currently released under GNU Lesser General Public License version 2.1

Bufferpool doesn't require other libraries beside the C runtime in order to build and run.

Netembryo - the network abstraction library Feng and Libnemesi depend upon

Netembryo is a network abstraction library (originated from our old wrapper socket) plus some misc utility functions used as foundation for feng, libnemesi, felix.

It provides an uniform access to the following protocols:

Netembryo 0.1.1 is available, otherwise you may fetch the live sources from our public git tree

Netembryo is currently released under the GNU General Public License version 2 the next releases will be under GNU Lesser General Public License version 2.1

Netembryo requires lksctp on linux, Solaris10 has already native support out of the box, the other systems have various degrees of support.

Legacy Software

The LSCube project has born from the old Fenice and Nemesi projects, which still exist on the git repository under the z_legacy directory.

Fenice - legacy streaming server

Fenice is a multimedia streaming server compliant with the IETF's standards for real-time streaming of multimedia contents over Internet. Fenice implements RTSP – Real-Time Streaming Protocol (rfc2326) and RTP/RTCP – Real-Time Transport Protocol/RTP Control Protocol (rfc3550) supporting the RTP Profile for Audio and Video Conferences with Minimal Control (rfc3551).

Fenice supports the following encoding standards:

The main characteristic of Fenice is that it is adaptable to the state of the network gotten through the technique of the dynamic coding change.

Fenice is also able to manage live streaming sessions using external real-time audio/video encoders such as lame, ffmpeg or mjpeg-tools, even capturing audio and video streams from live-recording remote hosts (using Felix).

Fenice is the world's first streaming server supporting Creative Commons licensing meta-data for audio/video streaming.

Follow the link to download latest release.

Felix - Multiplexer for live streams

Felix is a generic stream multiplexer, it is mainly used to feed fenice and feng live rtp streams, but could also be used for different purposes like as stand alone multicast repeater.

Felix 0.3.2 is available, otherwise you may fetch it from our public git tree or use a snapshot

Dependencies