2017-09-08 9 views
1

Essayer de faire fonctionner le streaming avec l'encodage x264.GStreamer x264 sous Linux (ARM)

que je fais un peu de magie noire avec coutures deux images qui est connu pour travailler:

gst-launch-1.0 -e \ 
    v4l2src device=/dev/video0 ! \ 
     video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_0 \ 
    v4l2src device=/dev/video1 ! \ 
     video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_1 \ 
    videomixer name=m sink_1::xpos=640 ! \ 
    video/x-raw,framerate=90/1,width=1280,height=480 ! \ 
    xvimagesink 

Maintenant, je suis en train d'obtenir même chose flux x264 avec l'aide d'internet:

gst-launch-1.0 -e \ 
    v4l2src device=/dev/video0 ! \ 
     video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_0 \ 
    v4l2src device=/dev/video1 ! \ 
     video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_1 \ 
    videomixer name=m sink_1::xpos=640 ! \ 
    video/x-raw,framerate=90/1,width=1280,height=480 ! \ 
    x264enc tune=zerolatency byte-stream=true bitrate=3000 threads=2 ! \ 
    h264parse config-interval=1 ! \ 
    rtph264pay ! \ 
    udpsink host=127.0.0.1 port=5000 

Et semble fonctionner parce qu'aucune erreur n'apparaît. Mais je ne vois aucun moyen de recevoir l'image.

J'ai essayé

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp ! rtph264depay ! h264parse ! avdec_h264 ! xvimagesink 

qui ne fournit pas quelque chose d'utile. Également tenté d'utiliser VLC avec le fichier SDP:

c=IN IP4 127.0.0.1 
m=video 5000 RTP/AVP 96 
a=rtpmap:96 H264/3000 

Je dois faire quelque chose de mal mais je ne sais pas quoi.

EDIT: Question sur la version de GStreamer. Probablement cette information est nécessaire:

[email protected]:~$ gst-launch-1.0 --version 
gst-launch-1.0 version 1.2.4 
GStreamer 1.2.4 
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0 
[email protected]:~$ 



$ dpkg -l | grep gstreamer 
ii gir1.2-gstreamer-1.0         1.2.4-0ubuntu1.1         armhf  Description: GObject introspection data for the GStreamer library 
ii gstreamer-tools          0.10.36-1.2ubuntu3         armhf  Tools for use with GStreamer 
ii gstreamer0.10-alsa:armhf        0.10.36-1.1ubuntu2         armhf  GStreamer plugin for ALSA 
ii gstreamer0.10-fluendo-mp3:armhf      0.10.23.debian-3         armhf  Fluendo mp3 decoder GStreamer 0.10 plugin 
ii gstreamer0.10-nice:armhf        0.1.4-1            armhf  ICE library (GStreamer 0.10 plugin) 
ii gstreamer0.10-plugins-bad:armhf      0.10.23-7.2ubuntu1.3        armhf  GStreamer plugins from the "bad" set 
ii gstreamer0.10-plugins-bad-multiverse     0.10.21-1ubuntu3         armhf  GStreamer plugins from the "bad" set (Multiverse Variant) 
ii gstreamer0.10-plugins-base:armhf      0.10.36-1.1ubuntu2         armhf  GStreamer plugins from the "base" set 
ii gstreamer0.10-plugins-base-apps      0.10.36-1.1ubuntu2         armhf  GStreamer helper programs from the "base" set 
ii gstreamer0.10-plugins-good:armhf      0.10.31-3+nmu1ubuntu5.2        armhf  GStreamer plugins from the "good" set 
ii gstreamer0.10-plugins-ugly:armhf      0.10.19-2ubuntu5         armhf  GStreamer plugins from the "ugly" set 
ii gstreamer0.10-pulseaudio:armhf      0.10.31-3+nmu1ubuntu5.2        armhf  GStreamer plugin for PulseAudio 
ii gstreamer0.10-tools         0.10.36-1.2ubuntu3         armhf  Tools for use with GStreamer 
ii gstreamer0.10-x:armhf         0.10.36-1.1ubuntu2         armhf  GStreamer plugins for X11 and Pango 
ii gstreamer1.0-alsa:armhf        1.2.4-1~ubuntu2          armhf  GStreamer plugin for ALSA 
ii gstreamer1.0-clutter         2.0.8-1build1          armhf  Clutter PLugin for GStreamer 1.0 
ii gstreamer1.0-fluendo-mp3:armhf      0.10.23.debian-3         armhf  Fluendo mp3 decoder GStreamer 1.0 plugin 
ii gstreamer1.0-libav:armhf        1.2.4-1~ubuntu1          armhf  libav plugin for GStreamer 
ii gstreamer1.0-nice:armhf        0.1.4-1            armhf  ICE library (GStreamer plugin) 
ii gstreamer1.0-plugins-bad:armhf      1.2.4-1~ubuntu1.1         armhf  GStreamer plugins from the "bad" set 
ii gstreamer1.0-plugins-bad-faad:armhf     1.2.4-1~ubuntu1.1         armhf  GStreamer faad plugin from the "bad" set 
ii gstreamer1.0-plugins-bad-videoparsers:armhf   1.2.4-1~ubuntu1.1         armhf  GStreamer videoparsers plugin from the "bad" set 
ii gstreamer1.0-plugins-base:armhf      1.2.4-1~ubuntu2          armhf  GStreamer plugins from the "base" set 
ii gstreamer1.0-plugins-base-apps      1.2.4-1~ubuntu2          armhf  GStreamer helper programs from the "base" set 
ii gstreamer1.0-plugins-good:armhf      1.2.4-1~ubuntu1.3         armhf  GStreamer plugins from the "good" set 
ii gstreamer1.0-plugins-ugly:armhf      1.2.3-2build1          armhf  GStreamer plugins from the "ugly" set 
ii gstreamer1.0-pulseaudio:armhf       1.2.4-1~ubuntu1.3         armhf  GStreamer plugin for PulseAudio 
ii gstreamer1.0-tools         1.2.4-0ubuntu1.1         armhf  Tools for use with GStreamer 
ii gstreamer1.0-x:armhf         1.2.4-1~ubuntu2          armhf  GStreamer plugins for X11 and Pango 
ii libgstreamer-plugins-bad0.10-0:armhf     0.10.23-7.2ubuntu1.3        armhf  GStreamer shared libraries from the "bad" set 
ii libgstreamer-plugins-bad1.0-0:armhf     1.2.4-1~ubuntu1.1         armhf  GStreamer development files for libraries from the "bad" set 
ii libgstreamer-plugins-base0.10-0:armhf     0.10.36-1.1ubuntu2         armhf  GStreamer libraries from the "base" set 
ii libgstreamer-plugins-base1.0-0:armhf     1.2.4-1~ubuntu2          armhf  GStreamer libraries from the "base" set 
ii libgstreamer-plugins-good1.0-0:armhf     1.2.4-1~ubuntu1.3         armhf  GStreamer development files for libraries from the "good" set 
ii libgstreamer0.10-0:armhf        0.10.36-1.2ubuntu3         armhf  Core GStreamer libraries and elements 
ii libgstreamer1.0-0:armhf        1.2.4-0ubuntu1.1         armhf  Core GStreamer libraries and elements 
$ 
+1

Êtes-vous sûr que votre cible est la manipulation de l'encodage logiciel x264 à 90 images par seconde? Quelle est votre version de GStreamer? – Ahresse

+1

Pour obtenir la version GStreamer: 'gst-launch-1.0 --version' – Ahresse

+0

J'ai besoin de vitesses assez élevées mais pour l'instant je peux réduire la vitesse pour réduire les contraintes. J'ai ajouté les informations de version du mieux que je pouvais. –

Répondre

1

Je propose vos différents points pour résoudre le problème:

  • Afin d'identifier si elle est sur le streaming ou la partie de codage de votre problème de pipeline se produit, peut vous essayez de lancer un pipeline avec un débit inférieur et un aperçu local:

    gst-launch-1.0 -e \ 
        v4l2src device=/dev/video0 ! videorate ! \ 
         video/x-raw,framerate=25/1,width=640,height=480 ! m.sink_0 \ 
        v4l2src device=/dev/video1 ! videorate ! \ 
         video/x-raw,framerate=25/1,width=640,height=480 ! m.sink_1 \ 
        videomixer name=m sink_1::xpos=640 ! \ 
        video/x-raw,framerate=25/1,width=1280,height=480 ! \ 
        x264enc tune=zerolatency byte-stream=true bitrate=3000 threads=0 ! \ 
        avdec_h264 ! xvimagesink sync=false 
    
  • en outre, vous pouvez essayer de lancer Wireshark ou tcpdump sur le Interfa loopback ce de votre système afin de surveiller le trafic le port 5000.

  • commutateur avec un encodeur matériel:

    gst-launch-1.0 -e \ 
        v4l2src device=/dev/video0 ! \ 
         video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_0 \ 
        v4l2src device=/dev/video1 ! videorate ! \ 
         video/x-raw,framerate=90/1,width=640,height=480 ! m.sink_1 \ 
        videomixer name=m sink_1::xpos=640 ! \ 
        video/x-raw,framerate=90/1,width=1280,height=480 ! \ 
        omxh264enc ! \ 
        avdec_h264 ! xvimagesink sync=false 
    
+0

J'ai utilisé tcpdump et voir le trafic. Je n'ai plus d'expérience avec le streaming pour savoir si c'est un bon trafic. –

+0

ERREUR: à partir de l'élément/GstPipeline: pipeline0/GstV4l2Src: v4l2src1: Erreur de flux de données interne. informations de débogage supplémentaires: gstbasesrc.c (2865): gst_base_src_loop():/GstPipeline: pipeline0/GstV4l2Src: v4l2src1: tâche de streaming en pause, la raison non négocié (-4) EOS sur l'arrêt activé - en attente d'EOS après Erreur –