Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
tutoriel:comment_creer_une_webradio [Le 13/04/2008, 15:13] 87.89.222.57, 127.0.0.1 |
tutoriel:comment_creer_une_webradio [Le 11/09/2022, 12:20] (Version actuelle) moths-art Suppression des espaces en fin de ligne (détecté et corrigé via le bot wiki-corrector (https://forum.ubuntu-fr.org/viewtopic.php?id=2067892) |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ===== Introduction ===== | + | {{tag>tutoriel radio audio}} |
- | Ce tutoriel a pour but d'expliquer le plus simplement possible l'installation d'une [[http://fr.wikipedia.org/wiki/Net_radio|Webradio]] sous Ubuntu.\\ | + | |
- | //Les webradios sont des stations plus ou moins semblables aux stations de radio. La particularité d’une webradio est qu’elle est diffusée sur Internet.// | + | ---- |
- | \\ | + | |
- | \\ | + | |
- | \\ | + | |
- | ===== Installation de paquets ===== | + | |
- | <note important>Avant d'installer ces paquets, vérifiez que vous avez les dépôts Universe/Multiverse activés : http://doc.ubuntu-fr.org/depots#universe_et_multiverse</note> | + | |
- | //[[:tutoriel:comment_installer_un_paquet|Installez les paquets]] **icecast2 mpd**// : | + | |
- | <code>sudo apt-get update | + | |
- | sudo apt-get install mpd icecast2</code> | + | |
+ | ====== Comment créer sa webradio ? ====== | ||
+ | |||
+ | Ce tutoriel a pour but d'expliquer le plus simplement possible l'installation d'une **[[:radio|Webradio]]** sous Ubuntu. | ||
+ | |||
+ | ===== Installation ===== | ||
+ | |||
+ | [[:tutoriel:comment_installer_un_paquet|Installez les paquets]] **[[apt>icecast2,mpd|icecast2 mpd]]**. (Les [[:depots#universe_et_multiverse|dépôts Universe/Multiverse]] doivent être activés.) | ||
===== Configuration de MPD ===== | ===== Configuration de MPD ===== | ||
+ | |||
Créer un fichier de configuration par défaut : | Créer un fichier de configuration par défaut : | ||
- | <code>sudo dpkg-reconfigure mpd</code> | ||
- | La configuration de MPD se fait par un simple fichier texte /etc/mpd.conf . [[:tutoriel:comment_editer_un_fichier|Editer ce fichier avec gedit]] : | ||
- | <code>sudo gedit /etc/mpd.conf</code> | ||
- | <note important>Voici un exemple du fichier mpd.conf à modifier en fonction de votre configuration !</note> | ||
- | <code># An example configuration file for MPD | ||
- | # See the mpd.conf man page for a more detailed description of each parameter. | ||
+ | sudo dpkg-reconfigure mpd | ||
+ | |||
+ | La configuration de MPD se fait par un fichier texte. [[:tutoriel:comment_editer_un_fichier|Éditer le fichier]] **/etc/mpd.conf**. | ||
+ | Avant la première utilisation de **mpd** , il est nécessaire de charger des musique dans la collection, sinon mpd n'aura aucune musique à lire. ( voir [[:mpd|Lien externe]] ) | ||
+ | |||
+ | Voici un exemple du fichier /etc/mpd.conf (à modifier en fonction de votre configuration) | ||
+ | |||
+ | <file> | ||
######################## REQUIRED PATHS ######################## | ######################## REQUIRED PATHS ######################## | ||
# You can put symlinks in here, if you like. Make sure that | # You can put symlinks in here, if you like. Make sure that | ||
# the user that mpd runs as (see the 'user' config parameter) | # the user that mpd runs as (see the 'user' config parameter) | ||
# can read the files in this directory. | # can read the files in this directory. | ||
- | music_directory "/home/pseudo/Musiques" #<----- LE CHEMIN VERS VOS FICHIERS DE MUSIQUES | + | music_directory "/home/pseudo/Musiques" #<----- LE CHEMIN VERS VOS FICHIERS DE MUSIQUE |
playlist_directory "/var/lib/mpd/playlists" | playlist_directory "/var/lib/mpd/playlists" | ||
db_file "/var/lib/mpd/tag_cache" | db_file "/var/lib/mpd/tag_cache" | ||
Ligne 32: | Ligne 33: | ||
error_file "/var/log/mpd/errors.log" | error_file "/var/log/mpd/errors.log" | ||
pid_file "/var/run/mpd/pid" | pid_file "/var/run/mpd/pid" | ||
- | ################################################################ | ||
- | |||
- | |||
- | ######################## OPTIONAL PATHS ######################## | ||
- | # | ||
- | # If specified, MPD will save its current state (playlist, | ||
- | # current song, playing/paused, etc.) at exit. This will be | ||
- | # used to restore the session the next time it is run. | ||
- | # | ||
- | state_file "/var/lib/mpd/state" | ||
- | # | ||
- | ################################################################ | ||
- | |||
- | |||
- | ######################## DAEMON OPTIONS ######################## | ||
- | # | ||
- | # If started as root, MPD will drop root privileges and run as | ||
- | # this user instead. Otherwise, MPD will run as the user it was | ||
- | # started by. If left unspecified, MPD will not drop root | ||
- | # privileges at all (not recommended). | ||
- | # | ||
- | user "mpd" | ||
- | # | ||
- | # The address and port to listen on. | ||
- | # | ||
- | #bind_to_address "127.0.0.1" | ||
- | #port "6600" | ||
- | # | ||
- | # Controls the amount of information that is logged. Can be | ||
- | # "default", "secure", or "verbose". | ||
- | # | ||
- | #log_level "default" | ||
- | # | ||
################################################################ | ################################################################ | ||
Ligne 74: | Ligne 42: | ||
# log in with that password are allowed to do. | # log in with that password are allowed to do. | ||
# | # | ||
- | password "VOTRE_MOT_DE_PASSE@read,add,control,admin" #<----- REMPLASSER 'VOTRE_MOT_DE_PASSE' | + | password "VOTRE_MOT_DE_PASSE@read,add,control,admin" #<----- REMPLACER 'VOTRE_MOT_DE_PASSE' |
# | # | ||
# Specifies what permissions a user who has not logged in with a | # Specifies what permissions a user who has not logged in with a | ||
Ligne 87: | Ligne 55: | ||
########################## AUDIO OUTPUT ######################## | ########################## AUDIO OUTPUT ######################## | ||
- | # | ||
- | # MPD supports many audio output types, as well as playing | ||
- | # through multiple audio outputs at the same time. You can | ||
- | # specify one or more here. If you don't specify any, MPD will | ||
- | # automatically scan for a usable audio output. | ||
- | # | ||
- | # See <http://mpd.wikia.com/wiki/Configuration#Audio_Outputs> | ||
- | # for examples of other audio outputs. | ||
- | # | ||
- | # An example of an ALSA output: | ||
- | # | ||
- | #audio_output { | ||
- | # type "alsa" | ||
- | # name "My ALSA Device" | ||
- | # device "hw:0,0" # optional | ||
- | # format "44100:16:2" # optional | ||
- | #} | ||
- | # | ||
- | # An example of an OSS output: | ||
- | # | ||
- | #audio_output { | ||
- | # type "oss" | ||
- | # name "My OSS Device" | ||
- | # device "/dev/dsp" # optional | ||
- | # format "44100:16:2" # optional | ||
- | #} | ||
- | # | ||
- | # An example of a shout output (for streaming to Icecast): | ||
- | # | ||
audio_output { | audio_output { | ||
type "shout" | type "shout" | ||
Ligne 121: | Ligne 60: | ||
host "127.0.0.1" | host "127.0.0.1" | ||
port "8000" | port "8000" | ||
+ | |||
mount "/mydoom666" #<----- NOM DE LA PLAYLIST SANS L'EXTENSION | mount "/mydoom666" #<----- NOM DE LA PLAYLIST SANS L'EXTENSION | ||
- | password "VOTRE_MOT_DE_PASSE" #<----- REMPLASSER 'VOTRE_MOT_DE_PASSE' | + | password "VOTRE_MOT_DE_PASSE" #<----- REMPLACER 'VOTRE_MOT_DE_PASSE' |
quality "5.0" | quality "5.0" | ||
# bitrate "128" | # bitrate "128" | ||
Ligne 136: | Ligne 76: | ||
# | # | ||
#audio_output_format "44100:16:2" | #audio_output_format "44100:16:2" | ||
- | # | ||
- | ################################################################ | ||
- | |||
- | |||
- | ############################# MIXER ############################ | ||
- | # | ||
- | # MPD needs to know what mixer settings to change when you | ||
- | # adjust the volume. If you don't specify one here, MPD will | ||
- | # pick one based on which ones it was compiled with support for. | ||
- | # | ||
- | # An example for controlling an ALSA mixer: | ||
- | # | ||
- | #mixer_type "alsa" | ||
- | #mixer_device "default" | ||
- | #mixer_control "PCM" | ||
- | # | ||
- | # An example for controlling an OSS mixer: | ||
- | # | ||
- | #mixer_type "oss" | ||
- | #mixer_device "/dev/mixer" | ||
- | #mixer_control "PCM" | ||
- | # | ||
- | # If you want MPD to adjust the volume of audio sent to the | ||
- | # audio outputs, you can tell it to use the software mixer: | ||
- | # | ||
- | #mixer_type "software" | ||
- | # | ||
- | ################################################################ | ||
- | |||
- | |||
- | ######################### NORMALIZATION ######################## | ||
- | # | ||
- | # Specifies the type of ReplayGain to use. Can be "album" or | ||
- | # "track". ReplayGain will not be used if not specified. See | ||
- | # <http://www.replaygain.org> for more details. | ||
- | # | ||
- | #replaygain "album" | ||
- | # | ||
- | # Sets the pre-amp used for files that have ReplayGain tags. | ||
- | # | ||
- | #replaygain_preamp "0" | ||
- | # | ||
- | # Enable on the fly volume normalization. This will cause the | ||
- | # volume of all songs played to be adjusted so that they sound | ||
- | # as though they are of equal loudness. | ||
- | # | ||
- | #volume_normalization "no" | ||
- | # | ||
- | ################################################################ | ||
- | |||
- | |||
- | ########################### BUFFERING ########################## | ||
- | # | ||
- | # The size of the buffer containing decoded audio. You probably | ||
- | # shouldn't change this. | ||
- | # | ||
- | #audio_buffer_size "2048" | ||
- | # | ||
- | # How much of the buffer to fill before beginning to play. | ||
- | # | ||
- | #buffer_before_play "0%" | ||
- | # | ||
- | # Similar options for the HTTP stream buffer. If you hear | ||
- | # skipping while playing HTTP streams, you may wish to increase | ||
- | # these. | ||
- | # | ||
- | #http_buffer_size "128" | ||
- | #http_prebuffer_size "25%" | ||
- | # | ||
- | ################################################################ | ||
- | |||
- | |||
- | ########################### HTTP PROXY ######################### | ||
- | # | ||
- | # Specifies the HTTP proxy to use for playing HTTP streams. | ||
- | # | ||
- | #http_proxy_host "proxy.isp.com" | ||
- | #http_proxy_port "8080" | ||
- | #http_proxy_user "user" | ||
- | #http_proxy_password "password" | ||
# | # | ||
################################################################ | ################################################################ | ||
Ligne 226: | Ligne 86: | ||
# restricting your usage of MPD. | # restricting your usage of MPD. | ||
# | # | ||
- | connection_timeout "60" | + | connection_timeout "60" |
max_connections "5" #<----- NOMBRE DE CONNECTION MAXIMUM | max_connections "5" #<----- NOMBRE DE CONNECTION MAXIMUM | ||
max_playlist_length "16384" | max_playlist_length "16384" | ||
Ligne 233: | Ligne 93: | ||
# | # | ||
################################################################ | ################################################################ | ||
+ | </file> | ||
- | ###################### CHARACTER ENCODINGS ##################### | + | ===== Configuration de Icecast2 ===== |
- | # | + | |
- | # If file or directory names do not display correctly, then you | + | |
- | # may need to change this. In most cases it should be either | + | |
- | # "ISO-8859-1" or "UTF-8". You must recreate your database | + | |
- | # after changing this (use mpd --create-db). | + | |
- | # | + | |
- | filesystem_charset "UTF-8" | + | |
- | # | + | |
- | # The encoding that ID3v1 tags should be converted from. | + | |
- | # | + | |
- | id3v1_encoding "UTF-8" | + | |
- | # | + | |
- | ################################################################ | + | |
+ | [[:tutoriel:comment_editer_un_fichier|Éditez le fichier]] **/etc/icecast2/icecast.xml**, fichier de configuration de Icecast2. | ||
+ | Il y a peu de choses à modifier, mis à part les mots de passe. | ||
- | ######################### OTHER OPTIONS ######################## | + | <file XML> |
- | # | + | <limits> |
- | # The metadata types MPD will recognize. | + | <clients>5</clients> |
- | # | + | <sources>5</sources> |
- | metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" | + | <threadpool>5</threadpool> |
- | # | + | <queue-size>524288</queue-size> |
- | # Enable this if you wish to use your MPD created playlists in | + | <client-timeout>30</client-timeout> |
- | # other music players. | + | <header-timeout>15</header-timeout> |
- | # | + | <source-timeout>10</source-timeout> |
- | #save_absolute_paths_in_playlists "no" | + | <burst-on-connect>1</burst-on-connect> |
- | # | + | <burst-size>65535</burst-size> |
- | ################################################################ | + | </limits> |
- | </code> | + | |
+ | <authentication> | ||
+ | <!-- Sources log in with username 'source' --> | ||
+ | <source-password>VOTRE_MOT_DE_PASSE</source-password> | ||
+ | <!-- Relays log in username 'relay' --> | ||
+ | <relay-password>VOTRE_MOT_DE_PASSE</relay-password> | ||
+ | |||
+ | <!-- Admin logs in with the username given below --> | ||
+ | <admin-user>admin</admin-user> | ||
+ | <admin-password>VOTRE_MOT_DE_PASSE</admin-password> | ||
+ | </authentication> | ||
+ | |||
+ | <hostname>127.0.0.1</hostname> | ||
+ | </file> | ||
+ | |||
+ | Pour faire tourner Icecast2 en tache de fond, [[:tutoriel:comment_editer_un_fichier|éditez le fichier]] **/etc/default/icecast2** et modifiez à la fin du fichier pour obtenir : | ||
+ | |||
+ | <file>ENABLE=true</file> | ||
- | ===== Configuration de Icecast2 ===== | ||
- | [[:tutoriel:comment_editer_un_fichier|Editer le fichier]] de configuration de Icecast2 : /etc/icecast2/icecast.xml | ||
- | <code>sudo gedit /etc/icecast2/icecast.xml</code> | ||
- | Il y a pas grand chose à modifier. A part les mots de passe. :-) | ||
- | <note important>Mon fichier icecast.xml à adapter en fonction de votre configuration ! http://mydoom666.free.fr/blog/img/misc/icecast.xml</note> | ||
- | Pour faire tourner Icecast2 en tache de fond, [[:tutoriel:comment_editer_un_fichier|editer le fichier]] /etc/default/icecast2 : | ||
- | <code>sudo gedit /etc/default/icecast2</code> | ||
- | Et modifier a la fin du fichier pour obtenir : | ||
- | <code>ENABLE=true</code> | ||
- | Terminé ! :-D\\ | ||
Relancer les services mpd et icecast2 : | Relancer les services mpd et icecast2 : | ||
- | <code>sudo /etc/init.d/mpd restart | ||
- | sudo /etc/init.d/icecast2 restart</code> | ||
- | Puis créer la base de donnée de MPD : | ||
- | <code>sudo mpd –create-db</code> | ||
- | <note>Vous pouvez maintenant accéder au serveur icecast2 à l’adresse : http://adresse.com:8000/ (http://127.0.0.1:8000/ si vous êtes en local).\\ | + | sudo /etc/init.d/mpd restart |
- | La playlist se trouve à l’adresse : http://adresse.com:8000/nom_de_la_playlist.m3u.\\ | + | sudo /etc/init.d/icecast2 restart |
- | Vous avez choisi le nom de cette playlist lors de la configuration du fichier mpd.conf. (Que vous pouvez modifier a tout moment, il faudra juste penser a relancer les services pour que les modifications soient prises en compte.</note> | + | <note> |
+ | Vous pouvez maintenant accéder au serveur icecast2 à l’adresse http://adresse.com:8000/ (http://127.0.0.1:8000/ si vous êtes en local). | ||
- | ===== Client de MPD ===== | + | La playlist se trouve à l’adresse : http://adresse.com:8000/nom_de_la_playlist.m3u. |
- | ==== GMPC ==== | + | Vous avez choisi le nom de cette playlist lors de la configuration du fichier « mpd.conf ». (Que vous pouvez modifier a tout moment, il faudra juste penser a relancer les services pour que les modifications soient prises en compte. |
- | GMPC est un client qui permet l’utilisation de MPD avec une interface graphique. | + | |
- | {{mydoom666_gmpc2.png}} | + | Bien entendu, il vous faut ensuite installer et démarrer un client MPD avant que icecast2 ne puisse jouer quoi que ce soit</note> |
- | [[http://i49.servimg.com/u/f49/11/19/52/01/09040810.jpg|(image 1280*1024 ici)]] | + | ===== Client de MPD ===== |
- | <note tip>Plus de captures : http://sarine.nl/gmpc-screenshots\\ | + | ==== PhpMp2 ==== |
- | Plus d’informations sur GMPC : http://www.musicpd.org/gmpc.shtml\\ | + | |
- | Plus de clients pour MPD : http://www.musicpd.org/clients.shtml</note> | + | |
- | <note important>Avant d'installer ce paquet, vérifiez que vous avez les dépôts Universe/Multiverse activés : http://doc.ubuntu-fr.org/depots#universe_et_multiverse</note> | + | PhpMp2 est un client qui tourne sur un serveur web (avec php). |
- | //[[:tutoriel:comment_installer_un_paquet|Installez les paquets]] **gmpc**// : | + | Ainsi si vous avez un serveur web vous pouvez l'installer et contrôler MPD de n'importe quelle machine connectée sur le net ayant un navigateur. |
- | <code>sudo apt-get install gmpc</code> | + | |
+ | Vous pouvez le télécharger à https://www.musicpd.org/phpMp2.shtml | ||
+ | Il faut décompresser l'archive dans un répertoire accessible sur votre serveur web. | ||
+ | {{tutoriel:phpmp2-mpd.jpg|}} | ||
===== Ouvrir le port dans le pare-feu ===== | ===== Ouvrir le port dans le pare-feu ===== | ||
- | Dernière étape, ouvrir le port 8000 dans le pare-feu. Le port 8000 (par défaut) est celui utilisé par icecast2 pour envoyer les flux aux clients. Pour cela, utiliser [[http://doc.ubuntu-fr.org/firestarter|Firestarter]]. | + | Dernière étape, ouvrir le port 8000 dans le [[:pare-feu]]. Le port 8000 (par défaut) est celui utilisé par Icecast2 pour envoyer les flux aux clients. Pour cela, utilisez [[:Gufw]].\\ |
- | <note help>[[http://doc.ubuntu-fr.org/firestarter#onglet_politique|Comment ajouter une règle à Iptables avec Firestarter]]</note> | + | |
Il est possible d’administrer votre serveur a distance en ouvrant le port 6600 (par défaut). Il suffira ensuite dans GMPC de bien spécifier l’adresse distante du serveur. | Il est possible d’administrer votre serveur a distance en ouvrant le port 6600 (par défaut). Il suffira ensuite dans GMPC de bien spécifier l’adresse distante du serveur. | ||
- | <note important>Attention, **ces ports doivent être ouverts** dans votre Routeur et Redirigés vers l’adresse IP de la machine serveur.</note> | + | <note important>**ces ports doivent être ouverts** dans votre routeur et redirigés vers l’adresse IP de la machine serveur.</note> |
+ | |||
+ | ===== Ressources Supplémentaires ===== | ||
+ | |||
+ | ==== Sites officiels ==== | ||
+ | * https://www.icecast.org/ | ||
+ | * https://www.musicpd.org/ | ||
+ | * [[wpfr>Net_radio]] | ||
+ | |||
+ | ==== Pour aller plus loin ==== | ||
- | ===== Informations supplémentaires ===== | + | * http://benjamin.sansinteret.info/blog/post/2008/11/28/Tutorial-Creer-une-webradio-avec-MPD-et-Icecast-sous-Linux-Gentoo-ou-Debian |
- | * http://www.icecast.org/ | + | * [[http://www.generation-linux.fr/index.php?post/2009/01/17/Mise-en-place-d-une-webradio-avec-Icecast-et-Liquidsoap| Mise en place d'une webradio avec Icecast et Liquidsoap ]] |
- | * http://www.musicpd.org/ | + | |
- | * http://fr.wikipedia.org/wiki/Net_radio | + | |
- | ===== Source ===== | + | |
- | * http://www.mydoom666.com/2008/04/creer-sa-webradio-sous-ubuntu | + | |
---- | ---- | ||
- | //Contributeurs : [[utilisateurs:Mydoom666]].// | + | //Contributeurs : [[utilisateurs:Mydoom666]], [[utilisateurs:Ner0lph]].// |