gstreamer网络摄像头vp9enc滞后

时间:2020-04-16 19:44:34

标签: go webrtc gstreamer

我已经用websocket信令服务器构建了一个小型的webrtc项目,并使用pion构建了webrtc部分。

但是使用gstreamer创建vp8或vp9流失败->高延迟

这是管道

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=320,framerate=10/1 ! videoconvert ! vp9enc ! decodebin ! autovideosink

但是视频非常缓慢,并且从gst打印出一些错误

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
WARNING: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage: A lot of buffers are being dropped.
Additional debug info:
../gstreamer/libs/gst/base/gstbasesink.c(3003): gst_base_sink_is_too_late (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage:
There may be a timestamping problem, or this computer is too slow.
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage: Output window was closed
Additional debug info:
../gst-plugins-base/sys/xvimage/xvimagesink.c(554): gst_xv_image_sink_handle_xevents (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage
Execution ended after 0:00:13.282962300
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

我的计算机是具有16G RAM的i5 ...肯定还有其他东西

1 个答案:

答案 0 :(得分:1)

我不知道vp9enc的等效项,但请查看vp8enc的这些设置

默认情况下,大多数编码器都不以实时速度运行,因此您必须设置一些选项。如果您找到正确的vp9选项,PR将会很棒!