Как отправить два видео от gstreamer - PullRequest
0 голосов
/ 19 июня 2019

Уважаемые

Я ищу способ поставить два видео рядом и отправить их в формате H.264.

#!/bin/bash
gst-launch-1.0 -e \
filesrc location="/home/namako/tairyou_2.mp4" \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=240" \
! videoconvert \
! videomixer.sink_0 \
\
filesrc location="/home/namako/tairyou_2.mp4" \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=240" \
! videoconvert \
! videomixer.sink_1 \
\
videomixer background=1 name=videomixer sink_0::xpos=0 sink_0::ypos=0 sink_1::xpos=512 sink_1::ypos=0 \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=240" \
! videoconvert \
! x264enc \
! rtph264pay \
! udpsink host=127.0.0.1 port=5000

Я сделал вышеуказанный код, но появилась следующая «ошибка».

パイプラインを一時停止 (PAUSED) にしています...
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Redistribute latency...
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstX264Enc:x264enc0: Can not initialize x264 encoder.
追加のデバッグ情報:
gstx264enc.c(1587): gst_x264_enc_init_encoder (): /GstPipeline:pipeline0/GstX264Enc:x264enc0
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Кажется, что h.264 не может быть закодирован.

Кроме того, с помощью приведенного выше кода он становится следующей схемой подключения конвейера.

введите описание изображения здесь

На схеме подключения вход видеомиксера - mpeg2, а выход - jpeg.

Что я должен сделать, чтобы вывести в mpeg2,H.264

1 Ответ

0 голосов
/ 22 июня 2019

Спасибо!Видео можно воспроизвести с помощью следующего кода.

#!/bin/bash
gst-launch-1.0 -e \
filesrc location="filename" \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=480,height=270" \
! videoconvert \
! videomixer.sink_0 \
\
filesrc location="filename" \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=480,height=270" \
! videoconvert \
! videomixer.sink_1 \
\
videomixer background=1 name=videomixer sink_0::xpos=0 sink_0::ypos=0 sink_1::xpos=480 sink_1::ypos=0 \
! decodebin \
! videoscale \
! capsfilter caps="video/x-raw,width=480,height=270" \
! videoconvert \
! x264enc \
! rtph264pay \
! udpsink host=127.0.0.1 port=5000
...