2011-09-15 8 views
6

Estoy tratando de hacer un comando para gstreamer para que pueda reproducir múltiples archivos de video simultáneamente. Así que he hecho un poco de investigación y encontré ésteIntentando reproducir múltiples archivos de video simultáneamente en Gstreamer

gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ 
    videotestsrc pattern=1 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \ 
    videobox border-alpha=0 top=0 left=0 ! mix. \ 
    videotestsrc pattern=15 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \ 
    videobox border-alpha=0 top=0 left=-320 ! mix. \ 
    videotestsrc pattern=13 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \ 
    videobox border-alpha=0 top=-180 left=0 ! mix. \ 
    videotestsrc pattern=0 ! video/x-raw-yuv, framerate=5/1, width=320, height=180 ! \ 
    videobox border-alpha=0 top=-180 left=-320 ! mix. \ 
    videotestsrc pattern=3 ! video/x-raw-yuv, framerate=5/1, width=640, height=360 ! mix. 

Ésta es la imagen de salida = http://i.stack.imgur.com/4lZWL.png

y aquí está el código que he modificado que supone que debe ser así

http://i.stack.imgur.com/Mdsc0.png

time gst-launch -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ 
    filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \ 
     width=320, height=180 ! videobox border-alpha=0 top=0 left=0 ! mix. \ 
    filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \ 
     width=320, height=180 ! videobox border-alpha=0 top=0 left=-320 ! mix. \ 
    filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \ 
     width=320, height=180 ! videobox border-alpha=0 top=-180 left=0 ! mix. \ 
    filesrc location=./Cityscape1Min_720p_mp4.mp4 ! video/x-raw-yuv, framerate=5/1, \ 
     width=320, height=180 ! videobox border-alpha=0 top=-180 left=-320 ! mix. 

Pero no funciona. Alguien tiene otras soluciones?

+0

supongo que necesita decodificar sus archivos de video. intenta insertar 'decodebin2! videorate! 'antes de cada elemento' videobox'. –

+0

todavía no se puede. error dicho Stream no contiene datos –

+0

'La transmisión no contiene datos'? ¿Estás seguro de que puedes reproducir el archivo solo con una canalización que no tiene videomixer? –

Respuesta

3

Me gusta este enfoque, creará una matriz de 2x2. sink_0 es tu fondo, también puedes configurarlo como una imagen. Más información sobre picture in picture.

gst-launch -e \ 
videomixer name=mix \ 
     sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=0\ 
     sink_1::xpos=0 sink_1::ypos=0 \ 
     sink_2::xpos=200 sink_2::ypos=0 \ 
     sink_3::xpos=0 sink_3::ypos=100 \ 
     sink_4::xpos=200 sink_4::ypos=100 \ 
    ! xvimagesink \ 
videotestsrc pattern="black" \ 
    ! video/x-raw-yuv,width=400,height=200 \ 
    ! mix.sink_0 \ 
uridecodebin uri='file:///home/user/video/test1.mp4' \ 
    ! ffmpegcolorspace ! videoscale \ 
    ! video/x-raw-yuv,width=200,height=100 \ 
    ! mix.sink_1 \ 
uridecodebin uri='file:///home/user/video/test2.mp4' \ 
    ! ffmpegcolorspace ! videoscale \ 
    ! video/x-raw-yuv,width=200,height=100 \ 
    ! mix.sink_2 \ 
uridecodebin uri='file:///home/user/video/test.avi' \ 
    ! ffmpegcolorspace ! videoscale \ 
    ! video/x-raw-yuv,width=200,height=100 \ 
    ! mix.sink_3 \ 
uridecodebin uri='mms://server/video/test.wmv' \ 
    ! ffmpegcolorspace ! videoscale \ 
    ! video/x-raw-yuv,width=200,height=100 \ 
    ! mix.sink_4 \ 
+0

¿Es posible crear la matriz 2x2 usando solo 'videosrc'? – CAMOBAP

0

Elimina framerate=5/1 de todos tus videos reales. Para mí, solo videotestsrc se puede modificar con framerate capfilter.

gst-launch-0.10 -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink \ 
    uridecodebin uri=file:///home/user/Desktop/sintel_trailer-480p.webm ! \ 
      ffmpegcolorspace ! videoscale ! \ 
      video/x-raw-yuv, width=320, height=180 ! \ 
      videobox border-alpha=0 top=0 left=0 ! mix. \ 
    videotestsrc pattern=15 ! \ 
      video/x-raw-yuv, width=320, height=180 ! \ 
      videobox border-alpha=0 top=0 left=-320 ! mix. \ 
    videotestsrc pattern=13 ! \ 
      video/x-raw-yuv, width=320, height=180 ! \ 
      videobox border-alpha=0 top=-180 left=0 ! mix. \ 
    videotestsrc pattern=0 ! \ 
      video/x-raw-yuv, width=320, height=180 ! \ 
      videobox border-alpha=0 top=-180 left=-320 ! mix. \ 
    videotestsrc pattern=3 ! \ 
      video/x-raw-yuv, framerate=5/1, width=640, height=360 ! mix. 
Cuestiones relacionadas