GStreamer Tee:x264enc + jpegenc - >僵局?

时间:2015-01-09 16:17:22

标签: gstreamer mp4 mjpeg tee

我有以下GStreamer命令正常工作:

1°)通过TCP传输2个MJPEG流:

gst-launch-1.0 v4l2src device=/dev/video0 ! deinterlace mode=1 ! videorate ! videoscale ! tee name=tp \
\
tp. ! queue ! video/x-raw, framerate=10/1, width=960, height=540 ! jpegenc quality=40 ! multipartmux ! tcpserversink host=0.0.0.0 port=8093 \
\
tp. ! queue ! video/x-raw, framerate=15/1, width=960, height=540 ! jpegenc quality=40 ! multipartmux ! tcpserversink host=0.0.0.0 port=8096

2°)通过TCP传输2个MP4流:

gst-launch-1.0 v4l2src device=/dev/video0 ! deinterlace mode=1 ! videorate ! videoscale ! tee name=tp \
\
tp. ! queue ! video/x-raw, framerate=10/1, width=960, height=540 ! x264enc bitrate=1000 ! mpegtsmux ! tcpserversink host=0.0.0.0 port=8093 \
\
tp. ! queue ! video/x-raw, framerate=15/1, width=960, height=540 ! x264enc bitrate=1000 ! mpegtsmux ! tcpserversink host=0.0.0.0 port=8096

但是这个没有(尝试通过TCP流式传输1个MJPEG流和1个MP4流):

gst-launch-1.0 v4l2src device=/dev/video0 ! deinterlace mode=1 ! videorate ! videoscale ! tee name=tp \
\
tp. ! queue ! video/x-raw, framerate=10/1, width=960, height=540 ! jpegenc quality=40 ! multipartmux ! tcpserversink host=0.0.0.0 port=8093 \
\
tp. ! queue ! video/x-raw, framerate=15/1, width=960, height=540 ! x264enc bitrate=1000 ! mpegtsmux ! tcpserversink host=0.0.0.0 port=8096

命令行说:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...

听起来不错,但是我无法在VLC中播放流(它正在使用第一个命令行)。

唯一的变化就是我替换了一个流:

jpegenc quality=40 ! multipartmux

by:

x264enc bitrate=1000 ! mpegtsmux 

任何帮助将不胜感激......

由于

1 个答案:

答案 0 :(得分:1)

在这里找到答案: http://gstreamer-devel.966125.n4.nabble.com/Pipeline-Freezes-When-Adding-In-Tee-With-x264enc-td4301890.html

使用" x264enc tune = zerolatency"让它发挥作用!