我正在尝试使用Gstreamer流式传输相机和麦克风音频视频。 使用Odroid C1 +作为服务器,使用PC作为客户端。 当我使用lan电缆时,它是完美的。但是当我使用WiFi时,它的性能会大大降低。
我用过
$ gst-launch-1.0 v4l2src ! gdppay ! tcpserversink host=localhost port=5000 alsasrc device="hw:1,0" ! gdppay ! tcpserversink host=localhost port=6000
$ gst-launch-1.0 tcpclientsrc host=localhost port=5000 ! gdpdepay ! autovideosink sync=false tcpclientsrc host=localhost port=6000 ! gdpdepay ! autoaudiosink sync=false
和
$ gst-launch-1.0 v4l2src ! videoconvert ! x264enc tune=zerolatency ! rtph264pay ! gdppay ! tcpserversink host=localhost port=5000 sync=false alsasrc device='hw:0,0' ! gdppay ! tcpserversink host=localhost port=6000 sync=false
$ gst-launch-1.0 tcpclientsrc host=localhost port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false tcpclientsrc host=localhost port=6000 ! gdpdepay ! autoaudiosink sync=false
如何最大化Gstreamer流媒体的性能, 并同步视频和音频?
更新
$ gst-launch-1.0 v4l2src ! vaapih264enc ! rtph264pay ! gdppay ! tcpserversink host=localhost port=5000
Setting pipeline to PAUSED ...
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vmwgfx_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vmwgfx_drv_video.so
libva info: va_openDriver() returns -1
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0: Could not initialize supporting library.
Additional debug info:
gstvideoencoder.c(1559): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0:
Failed to open encoder
Setting pipeline to NULL ...
Freeing pipeline ...
我在Ubuntu16.04上运行此操作,在i5-6400 CPU上运行VMware,没有GPU PC进行测试。