[icecast-dev] developpement flac avec Icecast

Arnaud Ebalard ebalard at enseirb.fr
Wed Jun 11 07:36:35 PDT 2003



Vincent Miekisiak wrote:

>
> Bonjour,
>
> Actuellement en 4ème année en ecole d'ingénieur, nous avons a 
> developper une application de streaming capable de gérer le format 
> Flac. Pour cela, nous avons repris les sources de Icecast et du 
> streamer Ices. Mais devant la difficulté de la manipulation de la 
> librairie Flac en tant que tel, nous avons choisi d'utiliser la 
> technologie Ogg pour transporter le flux audio flac.
> Ayant vu que votre équipe avait pour objectif d'adapter le serveur 
> Icecast avec la technologie Ogg pour plusieurs formats dont le Flac, 
> je me permets de vous écrire pour savoir si vous pouvez m'indiquer les 
> étapes à réaliser pour l'adaption en Flac.
> Je ne suis pas très fort en programmation audio et je bloque au niveau 
> conceptuel. (-:
>
> Je vous remercie,
> Cordialement
> Vincent Miekisiak
>
> _________________________________________________________________
> Hotmail : un compte GRATUIT qui vous suit partout et tout le temps ! 
> http://g.msn.fr/FR1000/9493
>
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> icecast project homepage: http://www.icecast.org/
> To unsubscribe from this list, send a message to 
> 'icecast-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is 
> needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>
>
Hello,

I can explain you how we did to open Icecast to new Ogg formats like 
speex, fLaC, Theora, ...
I hope it will help you.

The main idea is that a streaming source is recognized by Icecast based 
on its MIME type.
So, for Ogg vorbis, Ogg Speex and other Ogg encapsulated formats, the 
mime type is the
same.

After that recognition, the Ogg format module we developed for Icecast 
now look at the
first packet of the stream to detect the encapsulated format : speex, 
vorbis.

So, in order for you to add a fLaC support to icecast, you should go in 
the format_ogg.c file
and add some lines similar to those for speex and vorbis.
You should also create a format_ogg_flac.[ch] files with based on the 
content of the speex and
vorbis counterparts.

in format_ogg.c :

/* Now, we have the 8 first characters representing the
           * format of the encapsulated data*/
         
          /* We can compare this value with known formats */
          if ( memcmp( buffer , "Speex   " , 8 ) == 0 )
            {
              /* Let's give every field of state its own proper value
               * according the stream is an ogg speex stream*/
             
              actual_state->ogg_encapsulated_format_specific_data = 
format_ogg_speex_create_internal_data() ;
              actual_state->format_ogg_treat_data = 
format_ogg_speex_treat_data ;
              actual_state->format_ogg_free_internal_data = 
format_ogg_speex_free_internal_data ;
             
              format_ogg_speex_treat_data (raw_data, raw_data_len, 
actual_state , predata_out,
                                           predata_out_len, 
metadata_out, new_client_position);
            }
          else if (memcmp( buffer , "vorbis" , 6 ) == 0 )
            {
              /* Let's give every field of state its own proper value
               * according the stream is an ogg vorbis stream*/
              actual_state->ogg_encapsulated_format_specific_data = 
format_ogg_vorbis_create_internal_data() ;
              actual_state->format_ogg_treat_data = 
format_ogg_vorbis_treat_data ;
              actual_state->format_ogg_free_internal_data = 
format_ogg_vorbis_free_internal_data ;
            }
          *else if (memcmp( buffer , "fLaC" , 6 ) == 0 )
            {
              /* Let's give every field of state its own proper value
               * according the stream is an ogg vorbis stream*/
              actual_state->ogg_encapsulated_format_specific_data = 
format_ogg_flac_create_internal_data() ;
              actual_state->format_ogg_treat_data = 
format_ogg_flac_treat_data ;
              actual_state->format_ogg_free_internal_data = 
format_ogg_flac_free_internal_data ;
          }*

The creation of the fLaC module should be easy : I read the technical 
doc for fLaC and it uses vorbis comment
and info structure to store informations about the stream so you do just 
have to copy the format_ogg_vorbis
module.

The developper doc in docbook is available and gives further details (if 
the comments in the Doxygen doc
aren't sufficient).

If you have particular questions, don't hesitate.

Arnaud.

<p><p>ps : for the moment our work on Icecast is always on savannah's cvs. I 
hope someone watched what we did
       and will soon give us an idea on what will happen (I know it's a 
lot of time to read the whole sources
       and understand the differences but the doc should help).
       So if you want to get this sources you can ask for incorporation 
in developer community of the "interopcast"
       project (http://savannah.nongnu.org/) till the decision of xiph's 
developers. You will have access to the CVS
       in order to work on the project in an easier way.

pps : I think the big part of your project will be based on Ices and not 
on Icecast : the streaming part is the work of
        Ices. Icecast only serves clients with the streams that Ices 
creates. Icecast make "audio" stuff, it works as a relay
        between a stream (or more differents streams) and many clients 
who want to be served. The technical stuff is
        definitely in Ices.

ppps : "nous avons choisi d'utiliser la technologie Ogg pour transporter 
le flux audio flac". That's clear that Ogg is
       the solution to encapsulate audio formats like fLaC, vorbis, 
speex ... because it's an efficient "streaming encapsulation"
       and streaming servers like Icecast don't need many adjustments to 
add support. (same for player).

<p>Arnaud.
      

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast-dev mailing list