vendredi 27 décembre 2013

Gstreamer et Serveur de streaming RTSP sur Raspberry Pi (1ere Partie)

Ce tutoriel va nous permettre de construire, grâce à une raspberry pi, un serveur de streaming vidéo et/ou audio et notamment diffuser un flux vidéo provenant d'une caméra. N'ayant pas encore en ma possession le module caméra de la raspberry pi, je vais utiliser une webcam USB du commerce compatible avec la raspberry pi (USB Webcam).

Le serveur de streaming que nous allons installer est basé sur le protocole RTSP (Real Time Streaming Protocol). Ce protocole RTSP est implémenté sur la couche 7 du modèle OSI (couche applicative) et utilise les couches de transports RTP/RTCP pour faire circuler les flux de données sur un réseau IP.
L'avantage du RTSP est de diffuser un ou plusieurs flux seulement quand un client se connecte au serveur et ce même client peut interagir avec le flux de données (lecture, pause, retour en arrière, en avant, etc ...).

Ce tutoriel est divisé en deux billets, Ce billet est consacré à la construction et l'installation d'un serveur RTSP basé sur le framework GStreamer sur notre raspberry pi et le second billet est consacré à l'introduction de GStreamer avec des cas simples d'utilisation et notamment la démonstration de notre serveur RTSP.

Pour ce billet, nous allons travailler avec :
  • Notre environnement de compilation : buildroot-2013.08.1.
  • Kernel 3.12.0.
  • Chaîne de compilation croisée construite avec crosstool-NG 1.15.0.
  • Packages rpi-userland et rpi-firmware.
  • Framework GStreamer version 1.2.0 et ses plugins standards (base, bad, ugly et good) en version 1.2.0.
  • Plugin OMX (OpenMAX IL wrapper) version Git, qui nous permettra d'encoder les vidéos grâce aux GPU de la raspberry pi.
  • Serveur RTSP version Git aussi.

Préambule


Chaîne de compilation croisée



Pour ce projet, nous n'allons pas utiliser la chaîne de compilation croisée construite avec buildroot (basée sur uclibc) pour la simple raison que j'ai rencontré quelques (voir beaucoup ...) difficultés dans la gestion des threads glib2, que je n'ai pas encore pu résoudre.

Nous allons utiliser une chaîne de compilation croisée construite avec crosstool-NG déjà créée et se trouvant sur le github de raspberry pi.

Voici les commandes à utiliser :

# git clone https://github.com/raspberrypi/tools
# cd tools
# ls arm-bcm2708
arm-bcm2708-linux-gnueabi  arm-bcm2708hardfp-linux-gnueabi  gcc-linaro-arm-linux-gnueabihf-raspbian

Nous allons utiliser la chaîne de compilation croisée arm-bcm2708hardfp-linux-gnueabi pour ce projet.

Si ce n'est pas déjà fait, ne pas oublier de configurer correctement buildroot pour la raspberry pi avec la commande :

# make rpi_defconfig

Entrer dans le menu de buildroot:

# make menuconfig

Sur le menu de buildroot, cocher l'option EABIhf pour Target ABI :




Se rendre dans le sous menu Toolchain.

  • Sur le champ Toolchain type, choisir External Toolchain
  • Sur le champ Toolchain origin, choisir Pre-installed toolchain
  • Sur le champ Toolchain path, entrer le chemin vers la chaîne de compilation précédemment téléchargée (TOOLS_PATH/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi)
  • Sur le champ Toolchain prefix, entrer le préfixe arm-bcm2708hardfp-linux-gnueabi
  • Sur le champ External toolchain C library, choisir glibc/eglibc
  • Cocher les cases Toolchain has RPC support?, "Toolchain has C++ support? et Enable MMU support



L'environnement de compilation est maintenant prêt. On va passer à la suite.

Compilation et Installation de GStreamer et de ses plugins


Par défaut, les versions de GStreamer et de ses packages sont 1.0.8 avec cette version de buildroot, il va donc falloir modifier chaque makefile pour changer les versions en 1.2.0. La raison est que la version du serveur RTSP que nous allons utiliser a besoin d'une version de GStreamer >= 1.1.0

Les packages GStreamer se trouvent dans le dossier package/multimedia.
Les versions 0.10 et 1.0 sont présents dans ce dossier et se différencient avec les noms des packages.
Pour la version 0.10, "gst-plugin-xxxxxxx" ou "gstreamer", et pour la version 1.0, "gst1-plugin-xxxxxxx" ou "gstreamer1". Petite subtilité pour gst-omx qui a une dépendance avec gstreamer 1.0 et non gstreamer 0.10.

# ls package/multimedia -al
total 180
drwxr-xr-x  39 vbenoit users  4096 18 déc.  13:47 .
drwxr-xr-x 786 vbenoit users 20480 10 déc.  17:52 ..
-rw-r--r--   1 vbenoit users  2038 18 déc.  13:47 Config.in
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 alsa-utils
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 aumix
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 bellagio
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 faad2
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 ffmpeg
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 flac
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-dsp
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-ffmpeg
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-fsl-plugins
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-omapfb
drwxr-xr-x   2 vbenoit users  4096 13 déc.  21:48 gst-omx
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-plugin-x170
drwxr-xr-x   2 vbenoit users  4096  6 déc.  11:58 gst-plugins-bad
drwxr-xr-x   2 vbenoit users  4096 11 déc.  17:53 gst-plugins-base
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-plugins-good
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gst-plugins-ugly
drwxr-xr-x   2 vbenoit users  4096 11 déc.  19:25 gst1-plugins-bad
drwxr-xr-x   2 vbenoit users  4096 11 déc.  19:24 gst1-plugins-base
drwxr-xr-x   2 vbenoit users  4096 13 déc.  19:05 gst1-plugins-good
drwxr-xr-x   2 vbenoit users  4096 13 déc.  19:47 gst1-plugins-ugly
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 gstreamer
drwxr-xr-x   2 vbenoit users  4096 26 déc.  14:30 gstreamer1
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 lame
drwxr-xr-x   2 vbenoit users  4096 10 déc.  21:53 libvpx
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 madplay
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 mpd
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 mpg123
drwxr-xr-x   2 vbenoit users  4096 13 déc.  20:12 mplayer
-rw-r--r--   1 vbenoit users    34 17 sept. 13:42 multimedia.mk
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 musepack
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 on2-8170-libs
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 pulseaudio
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 tidsp-binaries
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 vorbis-tools
drwxr-xr-x   2 vbenoit users  4096 17 sept. 13:42 wavpack

Package gstreamer1


Se rendre dans le dossier package/multimedia/gstreamer1 et nous allons modifier la variable GSTREAMER1_VERSION dans le makefile.

################################################################################
#
# gstreamer1
#
################################################################################

#GSTREAMER1_VERSION = 1.0.8
GSTREAMER1_VERSION = 1.2.0
GSTREAMER1_SOURCE = gstreamer-$(GSTREAMER1_VERSION).tar.xz
GSTREAMER1_SITE = http://gstreamer.freedesktop.org/src/gstreamer
GSTREAMER1_INSTALL_STAGING = YES
GSTREAMER1_LICENSE_FILES = COPYING
GSTREAMER1_LICENSE = LGPLv2+ LGPLv2.1+
[...]

il va falloir aussi rajouter un patch, nommé gstreamer1-001-libtheora_lazy.patch, qui nous servira pour l'utilisation du plugin theora/ogg (voir la deuxième partie du tutoriel).
Sans ce patch, GStreamer n'arrivera pas à résoudre des symboles inclus dans les librairies tierces de theora.

--- a/gst/gstplugin.c   2013-07-05 01:50:56.000000000 +0200
+++ b/gst/gstplugin.c   2013-12-10 17:13:02.701218001 +0100
@@ -729,6 +729,8 @@
    * */
    if (strstr (filename, "libgstpython"))
      flags |= G_MODULE_BIND_LAZY;
 +  else if(strstr (filename, "libgsttheora"))
 +    flags |= G_MODULE_BIND_LAZY;
      module = g_module_open (filename, flags);
    if (module == NULL) {

Package gst1-plugin-bad


On fait la même chose avec le plugin bad de GStreamer.

################################################################################
#
# gst1-plugins-bad
#
################################################################################

#GST1_PLUGINS_BAD_VERSION = 1.0.8
GST1_PLUGINS_BAD_VERSION = 1.2.0
GST1_PLUGINS_BAD_SOURCE = gst-plugins-bad-$(GST1_PLUGINS_BAD_VERSION).tar.xz
GST1_PLUGINS_BAD_SITE = http://gstreamer.freedesktop.org/src/gst-plugins-bad
GST1_PLUGINS_BAD_LICENSE_FILES = COPYING COPYING.LIB
# Unknown and GPL licensed plugins will append to GST1_PLUGINS_BAD_LICENSE if
# enabled.
GST1_PLUGINS_BAD_LICENSE = LGPLv2+ LGPLv2.1+

GST1_PLUGINS_BAD_AUTORECONF = YES
GST1_PLUGINS_BAD_AUTORECONF_OPT = -I $(@D)/common/m4

Package gst1-plugin-base


de même avec le plugin base

################################################################################
#
# gst1-plugins-base
#
################################################################################

GST1_PLUGINS_BASE_VERSION = 1.2.0
#GST1_PLUGINS_BASE_VERSION = 1.0.8
GST1_PLUGINS_BASE_SOURCE = gst-plugins-base-$(GST1_PLUGINS_BASE_VERSION).tar.xz
GST1_PLUGINS_BASE_SITE = http://gstreamer.freedesktop.org/src/gst-plugins-base
GST1_PLUGINS_BASE_INSTALL_STAGING = YES
GST1_PLUGINS_BASE_LICENSE_FILES = COPYING.LIB
GST1_PLUGINS_BASE_LICENSE = LGPLv2+ LGPLv2.1+

Package gst1-plugin-ugly


de même avec le plugin ugly

################################################################################
#
# gst1-plugins-ugly
#
################################################################################

#GST1_PLUGINS_UGLY_VERSION = 1.0.8
GST1_PLUGINS_UGLY_VERSION = 1.2.0
GST1_PLUGINS_UGLY_SOURCE = gst-plugins-ugly-$(GST1_PLUGINS_UGLY_VERSION).tar.xz
GST1_PLUGINS_UGLY_SITE = http://gstreamer.freedesktop.org/src/gst-plugins-ugly
GST1_PLUGINS_UGLY_LICENSE_FILES = COPYING
# GPL licensed plugins will append to GST1_PLUGINS_UGLY_LICENSE if enabled.
GST1_PLUGINS_UGLY_LICENSE = LGPLv2.1+

Package gst1-plugin-good


de même avec le plugin good. J'ai également supprimé le patch pour ne pas l'appliquer.

################################################################################
#
# gst1-plugins-good
#
################################################################################

#GST1_PLUGINS_GOOD_VERSION = 1.0.8
GST1_PLUGINS_GOOD_VERSION = 1.2.0
GST1_PLUGINS_GOOD_SOURCE = gst-plugins-good-$(GST1_PLUGINS_GOOD_VERSION).tar.xz
GST1_PLUGINS_GOOD_SITE = http://gstreamer.freedesktop.org/src/gst-plugins-good
GST1_PLUGINS_GOOD_LICENSE_FILES = COPYING
GST1_PLUGINS_GOOD_LICENSE = LGPLv2.1+

Package Gstreamer OMX


La raspberry pi est "designé" autour d'un CPU contenant un GPU (Graphical Processor Unit) (Broadcom VideoCore IV) contenant les decodeurs OpenGL ES 1.1, OpenGL ES 2.0, accélération materielle OpenVG 1.1, Open EGL, OpenMAX.
Ce GPU va nous permettre de dissocier la tâche d'encodage vidéo aux autres traitement de la board (voir la démonstration dans la seconde partie du tutoriel).

Le package gst-omx de buildroot utilise une version assez ancienne, nous allons recréer un autre package (gst1-omx) pour une version plus récente.

# cd package/multimedia
# mkdir gst1-omx
# vim gst1-omx.mk

Buildroot gère assez mal les sous-modules Git, nécessaires pour la compilation du package, c'est pourquoi, pour cette version, après avoir téléchargé le package, on lance le script GST1_OMX_RUN_AUTOCONF pour créer le fichier de configuration.
Nous sommes obligés de patcher la version de buildroot avec la variable GST1_OMX_LIBTOOL_PATCH = yes, sinon il va nous faire une belle erreur
de linkage en essayant de linker une librairie de la machine hôte.

################################################################################
#
# gst1-omx
#
################################################################################

GST1_OMX_VERSION = 8932bef0f3407a5b49f764878197eb24e68542d6
GST1_OMX_SOURCE = gst-omx-$(GST1_OMX_VERSION).tar.gz
GST1_OMX_SITE = http://cgit.freedesktop.org/gstreamer/gst-omx/snapshot/
GST1_OMX_LIBTOOL_PATCH = YES
GST1_OMX_AUTORECONF = YES
GST1_OMX_LICENSE = LGPLv2.1
GST1_OMX_LICENSE_FILES = COPYING

ifeq ($(BR2_PACKAGE_RPI_USERLAND),y)
GST1_OMX_CONF_OPT = \
        --with-omx-target=rpi
GST1_OMX_CONF_ENV = \
        CFLAGS="$(TARGET_CFLAGS) \
        -I$(STAGING_DIR)/usr/include/IL \
        -I$(STAGING_DIR)/usr/include/interface/vcos/pthreads \
        -I$(STAGING_DIR)/usr/include/interface/vmcs_host/linux \
        -Wno-deprecated-declarations"
endif

ifeq ($(BR2_PACKAGE_BELLAGIO),y)
GST1_OMX_CONF_OPT = \
        --with-omx-target=bellagio
GST1_OMX_CONF_ENV = \
        CFLAGS="$(TARGET_CFLAGS) \
        -DOMX_VERSION_MAJOR=1 \
        -DOMX_VERSION_MINOR=1 \
        -DOMX_VERSION_REVISION=2 \
        -DOMX_VERSION_STEP=0"
endif

define GST1_OMX_RUN_AUTOCONF
    (cd $(@D); \
     mkdir m4; \
     rm common -rf; \
     git init; \
     git remote add project git://anongit.freedesktop.org/gstreamer/gst-omx; \
     git fetch project; \
     git submodule add git://anongit.freedesktop.org/gstreamer/common common; )
        
    (cd $(@D); \
     LIBTOOLIZE=$(LIBTOOLIZE) \
     ACLOCAL_FLAGS=$(ACLOCAL_FLAGS) \
     ACLOCAL="$(ACLOCAL)" \
     AUTOHEADER=$(AUTOHEADER) \
     AUTOCONF=$(AUTOCONF) \
     AUTOMAKE=$(AUTOMAKE) \
     AUTOM4TE=$(HOST_DIR)/usr/bin/autom4te \
     NOCONFIGURE=1 \
     ./autogen.sh --nocheck)
endef

GST1_OMX_PRE_CONFIGURE_HOOKS += GST1_OMX_RUN_AUTOCONF
GST1_OMX_DEPENDENCIES = gstreamer1 gst1-plugins-base libopenmax

$(eval $(autotools-package))

Nous allons ensuite créer le fichier Config.in :

# vim Config.in

config BR2_PACKAGE_GST1_OMX
    bool "gst1-omx"
    depends on BR2_PACKAGE_GSTREAMER1 && BR2_PACKAGE_HAS_OPENMAX
    select BR2_PACKAGE_GST1_PLUGINS_BASE
    help
        GStreamer plug-in to use OpenMAX API.
 
        http://cgit.freedesktop.org/gstreamer/gst-omx

    comment "gst-omx requires a OpenMAX implementation"
        depends on BR2_PACKAGE_GSTREAMER1 && !BR2_PACKAGE_HAS_OPENMAX

puis un patch pour un fichier de configuration a insérer sur le système de fichiers qui servira a indiquer le chemin des librairies pour l'encodeur vidéo.
Le fichier se nommera : gst1-omx-config-files.patch

Change config files to match default buildroot install

Signed-off-by: Spenser Gilliland 
---
Index: gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6/config/bellagio/gstomx.conf
===================================================================
--- gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6.orig/config/bellagio/gstomx.conf   2013-03-12 04:12:09.000000000 -0500
+++ gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6/config/bellagio/gstomx.conf    2013-05-21 17:50:14.545692908 -0500
@@ -1,6 +1,6 @@
 [omxmpeg4videodec]
 type-name=GstOMXMPEG4VideoDec
-core-name=/usr/local/lib/libomxil-bellagio.so.0
+core-name=/usr/lib/libomxil-bellagio.so.0
 component-name=OMX.st.video_decoder.mpeg4
 rank=256
 in-port-index=0
@@ -9,7 +9,7 @@
      
 [omxh264dec]
 type-name=GstOMXH264Dec
-core-name=/usr/local/lib/libomxil-bellagio.so.0
+core-name=/usr/lib/libomxil-bellagio.so.0
 component-name=OMX.st.video_decoder.avc
 rank=256
 in-port-index=0
@@ -18,7 +18,7 @@
            
 [omxmpeg4videoenc]
 type-name=GstOMXMPEG4VideoEnc
-core-name=/usr/local/lib/libomxil-bellagio.so.0
+core-name=/usr/lib/libomxil-bellagio.so.0
 component-name=OMX.st.video_encoder.mpeg4
 rank=0
 in-port-index=0
@@ -27,7 +27,7 @@
                  
 [omxaacenc]
 type-name=GstOMXAACEnc
-core-name=/usr/local/lib/libomxil-bellagio.so.0
+core-name=/usr/lib/libomxil-bellagio.so.0
 component-name=OMX.st.audio_encoder.aac
 rank=0
 in-port-index=0
 Index: gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6/config/rpi/gstomx.conf
==================================================================
--- gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6.orig/config/rpi/gstomx.conf 2013-05-21 17:51:39.965693635 -0500
+++ gst-omx-8932bef0f3407a5b49f764878197eb24e68542d6/config/rpi/gstomx.conf  2013-05-21 17:52:07.781693871 -0500
@@ -1,6 +1,6 @@
 [omxmpeg2videodec]
 type-name=GstOMXMPEG2VideoDec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -9,7 +9,7 @@
                             
 [omxmpeg4videodec]
 type-name=GstOMXMPEG4VideoDec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -18,7 +18,7 @@
                                   
 [omxh263dec]
 type-name=GstOMXH263Dec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -27,7 +27,7 @@
                                         
 [omxh264dec]
 type-name=GstOMXH264Dec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -36,7 +36,7 @@
                                               
 [omxtheoradec]
 type-name=GstOMXTheoraDec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -45,7 +45,7 @@
                                                     
 [omxvp8dec]
 type-name=GstOMXVP8Dec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -54,7 +54,7 @@
                                                           
 [omxmjpegdec]
 type-name=GstOMXMJPEGDec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_decode
 rank=256
 in-port-index=130
@@ -63,7 +63,7 @@
                                                                 
 [omxvc1dec]
 type-name=GstOMXWMVDec
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_encode
 rank=256
 in-port-index=130
@@ -73,7 +73,7 @@
                                                                       
 [omxh264enc]
 type-name=GstOMXH264Enc
-core-name=/opt/vc/lib/libopenmaxil.so
+core-name=/usr/lib/libopenmaxil.so
 component-name=OMX.broadcom.video_encode
 rank=256
 in-port-index=200

Ne pas oublier de rajouter dans le fichier Config.in du dossier multimedia la ligne :

source "package/multimedia/gst1-omx/Config.in"

Package Serveur RTSP


Ce package va être créé exactement sur le même principe que le package gst-omx surtout pour le makefile.

################################################################################
#
# gst1-rtsp-server
#
################################################################################

GST1_RTSP_SERVER_VERSION = ab3651d3393d3771975e6f1180ea9adf1fde0605
GST1_RTSP_SERVER_SOURCE = gst-rtsp-server-$(GST1_RTSP_SERVER_VERSION).tar.gz
GST1_RTSP_SERVER_SITE = http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/snapshot

GST1_RTSP_SERVER_LIBTOOL_PATCH = YES
GST1_RTSP_SERVER_AUTORECONF = YES
GST1_RTSP_SERVER_INSTALL_STAGING = YES
GST1_RTSP_SERVER_DEPENDENCIES = gstreamer1

GST1_RTSP_SERVER_CONF_OPT = \
        --disable-dependency-tracking \
        --disable-libtool-lock \
        --disable-nls \
        --disable-rpath \
        --disable-valgrind

define GST1_RTSP_SERVER_PRE_CONFIG
    (cd $(@D); \
     mkdir m4; \
     rm common -rf; \
     git init; \
     git remote add project git://anongit.freedesktop.org/gstreamer/gst-rtsp-server; \
     git fetch project; \
     git submodule add git://anongit.freedesktop.org/gstreamer/common common;)

    (cd $(@D); \
    LIBTOOLIZE=$(LIBTOOLIZE) \
    ACLOCAL_FLAGS=$(ACLOCAL_FLAGS) \
    ACLOCAL="$(ACLOCAL)" \
    AUTOHEADER=$(AUTOHEADER) \
    AUTOCONF=$(AUTOCONF) \
    AUTOMAKE=$(AUTOMAKE) \
    AUTOM4TE=$(HOST_DIR)/usr/bin/autom4te \
    NOCONFIGURE=1 \
    ./autogen.sh --nocheck)
endef

GST1_RTSP_SERVER_PRE_CONFIGURE_HOOKS += GST1_RTSP_SERVER_PRE_CONFIG

$(eval $(autotools-package))

Le fichier Config.in :

config BR2_PACKAGE_GST1_RTSP_SERVER
 bool "gst1-rtsp-server"
 depends on BR2_PACKAGE_GSTREAMER1
 help
   GStreamer RTSP server

   http://gstreamer.freedesktop.org/

finalement, ajouter la ligne suivante dans le fichier Config.in du dossier multimédia :

source "package/multimedia/gst1-rtsp-server/Config.in"

Finalement, après avoir créer les deux nouveaux packages, nous allons pouvoir les sélectionner dans le menu de buildroot.


Plugins tierces à installer


Dans le menu de buildroot, nous allons choisir une liste de plugins a installer sur notre système de fichiers.
Se rendre dans Target packages puis Audio and video applications

dans le sous-menu gst1-plugin-base, choisir :

[ ]   adder
[*]   app 
[*]   audioconvert (mandatory for audio playback)
[*]   audiorate
[*]   audiotestsrc
[*]   encoding 
[*]   videoconvert
[ ]   gio
[*]   playback
[*]   audioresample (mandatory for audio playback)
[*]   subparse 
[*]   tcp
-*-   typefind
[*]   videotestsrc
[*]   videorate 
[*]   videoscale (mandatory for video playback)
[*]   volume (mandatory for audio playback)
      *** plugins with external dependencies ***
[ ]   alsa (mandatory for audio playback)
[ ]   tremor
[*]   ogg (*.ogg audio/video)
[ ]   pango font renderer
[*]   theora (*.ogg video)
[*]   vorbis (*.ogg audio)

dans le sous-menu gst1-plugin-good, choisir :

[*]   jpeg (JPEG support)
[*]   png (PNG support)
      *** dependency-less plugins ***
[ ]   alpha
[ ]   apetag
[ ]   audiofx
[*]   audioparsers
[ ]   auparse
[*]   autodetect
[*]   avi (*.avi video)
[ ]   cutter
[ ]   debugutils
[ ]   deinterlace
[ ]   effectv
[ ]   equalizer
[*]   flv
[*]   flx
[ ]   goom
[ ]   goom2k1
[ ]   icydemux
[ ]   id3demux (*.mp3 audio)
[ ]   imagefreeze
[*]   interleave 
[*]   isomp4 
[ ]   law
[*]   level 
[ ]   matroska
[ ]   monoscope 
[ ]   multifile 
[ ]   multipart 
[ ]   replaygain
[*]   rtp
[*]   rtpmanager 
[*]   rtsp 
[ ]   shapewipe
[ ]   smpte
[ ]   spectrum 
[*]   udp 
[ ]   videobox
[*]   videocrop
[*]   videofilter
[*]   videomixer 
[ ]   wavenc
[*]   wavparse (*.wav audio)
[*]   y4m 
      *** plugins with external dependencies ***
[ ]   ossaudio (OSS audio) 
[ ]   oss4 (Open Sound System 4)
[*]   v4l2
[ ]   cairo 
[ ]   flac (libFLAC)
[ ]   gdkpixbuf
[ ]   pulseaudio
[ ]   souphttpsrc (http client)
[ ]   speex
[ ]   vpx (webm)
[ ]   vpx (webm)
[ ]   wavpack (*.wv audio) 

dans le sous-menu gst1-plugin-bad, choisir :

[*]   adpcmdec
[*]   adpcmenc  
[*]   aiff 
[*]   asfmux 
[ ]   audiovisualizers 
[ ]   autoconvert
[ ]   bayer
[*]   camerabin2
[ ]   cdxaparse
[*]   coloreffects
[*]   dataurisrc
[ ]   dccp
[*]   debugutils 
[ ]   dtmf
[ ]   dvdsuboverlay
[ ]   dvdspu
[ ]   faceoverlay 
[ ]   festival
[ ]   fieldanalysis
[ ]   freeverb
[ ]   frei0r
[ ]   gaudieffects 
[ ]   geometrictransform
[ ]   gdp
[ ]   hdvparse 
[ ]   hls
[ ]   id3tag
[ ]   inter 
[ ]   interlace
[ ]   ivfparse
[ ]   jp2kdecimator
[*]   jpegformat
[*]   librfb
[ ]   liveadder
[*]   mpegdemux
[*]   mpegtsdemux
[*]   mpegtsmux 
[*]   mpegpsmux
[ ]   mve 
[ ]   mxf
[*]   nuvdemux 
[ ]   patchdetect
[ ]   pcapparse 
[*]   pnm 
[*]   rawparse
[ ]   real  
[ ]   removesilence 
[*]   rtpmux 
[ ]   rtpvp8
[ ]   scaletempo
[*]   sdi
[*]   sdp
[ ]   segmentclip
[ ]   siren
[ ]   smooth
[*]   speed
[*]   subenc
[ ]   stereo
[ ]   tta
[ ]   videofilters
[ ]   videomeasure  
[ ]   videoparsers
[ ]   videosignal
[ ]   vmnc
[ ]   y4m
      *** plugins with external dependencies ***
[ ]   shm
[ ]   vcd
[ ]   apexsink
[*]   bz2
[ ]   cdaudio 
[ ]   celt
[ ]   curl
[ ]   decklink
      *** decklink requires a toolchain with C++ support enabled **
[ ]   directfb 
[ ]   wayland 
[ ]   faad
[ ]   fbdev
[ ]   libmms
      *** libmms requires a toolchain with WCHAR and threading supp
[ ]   mpeg2enc 
[ ]   mpg123
[ ]   musepack 
[ ]   neon
[ ]   opencv
[ ]   opus
[ ]   rsvg
[ ]   eglgles
[ ]   sdl
[ ]   sndfile
      *** gst-plugins-bad-plugin-sndfile requires a toolchain with 
[ ]   dvb

dans le sous-menu gst1-plugin-ugly, choisir :

[ ]   asfdemux 
[ ]   dvdlpcmdec
[ ]   dvdsub
[ ]   xingmux
[*]   realmedia
      *** plugins with external dependencies (there may be more available)
[ ]   dvdread 
[*]   lame (*.mp3 audio encoder)
[*]   mad (*.mp3 audio) 
[*]   mpeg2dec

Conclusion


Une fois toutes ces étapes effectuées, nous pouvons construire notre système de fichiers avec la commande make :

# make

Nous allons pouvoir passer à la deuxième partie du tutoriel pour vérifier le bon fonctionnement de notre serveur RTSP et des plugins GStreamer installés.

2 commentaires:

  1. Bonjour,

    quand j'ecris cette ligne: make rpi_defconfig
    je rencontre ce message d'erreur:
    make: *** Pas de règle pour fabriquer la cible « rpi_defconfig ». Arrêt.

    Une idee?
    Merci beaucoup.

    RépondreSupprimer
    Réponses
    1. le fichier de configuration "rpi_defconfig" doit se trouver dans le dossier configs de buildroot et la commande #make rpi_defconfig est a lancer à la base de buildroot

      Supprimer