Magma for Streaming Media

From Gnufu

This Document in Plain-Text-Format: http://gnuticles.gnufu.net/magma-for-streaming-mediav0.07.txt

# Magma for streaming media v0.07
# This File was written by Arne Babenhauserheide in 2005 and published under the 
# GNU GPLv2. 
# Copyright is at Arne Babenhauserheide ( http://draketo.de ). 

# The follwing gives examples how magma-lists can be used to stream 
# radio, television or similar media content via p2p networks
# using magma-lists. 

# This draft is in alpha-stage, because it is still missing a 
# reference-implementation and because the used tags haven't been 
# checked if they are the exact best choice, but it should be enough 
# to give you a glimpse of future possibilities of magma-lists. 

This document describes a way to use the new MAGMA-specs for streaming media. 

With the new MAGMA-specs it will be possible to stream radio streams over p2p-Networks. They can be set to play at a certain time, so all listeners listen to the same content at the same time, but they have to be pre-prepared to do so (a time lag of 5 to 30 minutes should be accounted for, as the files need time to spread in the network. Partial Filesharing makes it possible to keep the lag small, because Users automatically upload the parts they already have to other Users. 

For this I defined some parameters to be used with p2p-streaming. I'll explain them in an example MAGMA-streaming file. 

There are two types of streams: Timed streams, which shall be played at a certain time, and untimed streams, which shall be played as soon as the first part of the stream has been downloaded completely. This first example covers timed-streams. 

=====BEGIN EXAMPLE FILE=====
#MAGMAv0.2 magnet:?mt=.&as=http://files.gnufu.net/magma-streaming-example.magma

# This example would be a file which could be used by a radio-station. 
# If some of the files are already on the users' hard-disk, 
# the programs should recognize them and use them directly 
# instead of downloading them. 
# With this, one further capability of magnets gets incorporated. 

list-type: timed stream, updating file
update-interval-ms: 60000
update-source: magnet:?as=http://files.gnufu.net/magma-updating-streaming-example.magma
title: <name of the stream, radio station, whatever>

# For static magma-files the next-update-source parameter can be used
# instead of the update-source parameter. 
# This way multiple MAGMA-files can be pre-prepared for a few hours in advance
# and can be delivered as soon as the next magma-file is ready. 
# In this case the list type needs to be "stream, static". 
# The list-type parameter should be given before the update-parameters. 
# Example follows: 

list-type: timed stream, static file
next-update-source: "magnet:?xt=und:sha1:<hash-code>&as=http://files.gnufu.net/magma-static-streaming-example2.magma
next-update-time: <yyyy-mm-dd %dh%dm%ds%dms GMTx> 
title: <name of the stream, radio station, whatever>

# Generally the head can contain additional information on the stream. 
# Examples follow: 

global-transition-effects: 
  - <a tag-uri (http://tag-uri.org) as effect-identificator>: 
    magnet: <magnet-link>
    name: <name>
    version: <a version-number>
    description: <description>
    author: <authos-name>
# The effect which should be used by the media-program to do 
# the transitions between the files. If multiple effects are given, 
# the program should choose at random. 
# after the author-name additional information can be added as 
# follows in the example for the stream-creator. 

# Information about the creator of teh stream: 

creator: <name of the creator of the streams>: 
  nickname: <nickname, indented by two spaces>
  homepage: <homepage, indented by two spaces>
  e-mail: <e-mail, indented by two spaces>
  birthdate-yyyy-mm-dd: <birthdate, also indented by two spaces>
  # There can be any number of additional information about the creator. 
  # By making the additional Infos subfields of the name, more than one creator 
  # can be given. 

list: 
 - "<magnet>"
  time-to-play: <yyyy-mm-dd %dh%dm%ds%dms GMTx>
  # this might look like time-to-play: 2004-06-30 15h06m15s00ms GMT-0300
  # All times are in GMT as it is done in E-Mails. 
  
  MIME-type: <example: "audio/mp3">
  length-ms: <example: "90151">
  bitrate-KBit: <example: "160">
  size-Bytes: <ecample: "3005822">
  # the size should be used by the p2p programm to determine 
  # how much lag it should take into consideration
  # and if it will be able to fetch the file completely before the time-to-play. 
  
  track-name: <track-name>
  artist: <artist>
  album: <album>
  # These can be used by the p2p-App to locate different versions of the file, 
  # Which don't share the same hash, but contain the same music. 
  # To ensure that the content matches, the length of the track 
  # should be off by at most 200ms. 
  
  lag-expected-ms: <the expected lag in ms>
  # This can be used to make it easier for the program to determine which files
  # it can get early enough to play them in time. 
  # While some programs may rely on this, they should rather determine the 
  # expected lag themselves. This serves mainly to make the stremaing easier
  # to implement. Stats how much lag is expected for which filesizes 
  # according to the upload speed you have and the size of your audience
  # will follow. 
  
  transition-effect: <a tag-uri (http://tag-uri.org) as effect-identificator>: 
   magnet: <magnet-link>
   name: <name>
   version: <a version-number>
   description: <description>
   creator: <creator-name>
  # The effect which should be used by the media-program to do 
  # the transitions between the files. If multiple effects are given, 
  # the program should choose at random. 
  # after the author-name additional information can be added as 
  # seen in the example for the stream-creator.
Links