下面的管道使用OpenCV VideoWriter元素从我的程序内部运行。
gst-launch-1.0 -v videotestsrc ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm wait-for-connection=false当我通过以下管道使用流时,一切都正常。
gst-launch-1.0 -v shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
"video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
queue ! videoconvert ! autovideosink但是,当我尝试用以下管道在h264中对流进行编码时
gst-launch-1.0 -vvv shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
"video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! \
rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=127.0.0.1 port=5000我得到了
(gst-launch-1.0:8119): GStreamer-CRITICAL **: gst_segment_to_running_time: assertion 'segment->format == format' failed
我在VLC上什么也看不见。我遗漏了什么?
注意事项:要重现这个问题,可以使用以下生产者/消费者管道:
gst-launch-1.0 -v videotestsrc ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm wait-for-connection=falsesudo gst-launch-1.0 -vvv shmsrc is-live=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
"video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=127.0.0.1 port=5000系统信息
发布于 2020-02-06 09:16:11
最后,我找到了帮助我解决问题的这文章。
我最后的管道如下所示。
生产者管道
gst-launch-1.0 -v videotestsrc is-live=true ! clockoverlay ! shmsink socket-path=/tmp/sink shm-size=2000000 name=/dev/shm sync=true wait-for-connection=false消费管线
gst-launch-1.0 -vvv shmsrc is-live=true do-timestamp=true socket-path=/tmp/sink shm-area-name=/dev/shm ! \
"video/x-raw, format=BGR, width=(int)160, height=(int)120, framerate=(fraction)30/1" ! \
queue ! videoconvert ! x264enc bitrate=1000 ! video/x-h264,profile=baseline ! rtph264pay config-interval=1 pt=96 ! queue ! udpsink host=192.168.200.255 port=5000 sync=falsehttps://stackoverflow.com/questions/60074726
复制相似问题