我需要使用H264将我的屏幕全部流式传输到带有gstreamer的Android手机。我在Android上使用gst launch remote,在linux上使用gst-launch
。
我从gstreamer开始,我设法在this tutorial之后做基本流,但是与示例有点不同的是在各种方式崩溃。
我的基本渠道是:
ximagesrc use-damage=false xname=/usr/lib/torcs/torcs-bin ! videoconvert ! x264enc tune=zerolatency ! rtph264pay ! udpsink host=192.168.0.100 port=5000
和
udpsrc port=5000 caps=$CAPS ! rtph264depay ! avdec_h264 ! autovideosink
我将第一个管道中的大写字母(所有或多个孤立参数的组合)复制到$CAPS
,但不起作用。
用
caps="video/x-h264\,\ codec_data\=\(buffer\)01f40028ffe1001a67f400289196401e0089f89c0440000003004000000ca3c60c9201000668ebcc448440\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)4\,\ profile\=\(string\)high-4:4:4\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)25/1"
管道未构建,唯一的错误是:
WARNING: erroneous pipeline: could not link udpsrc0 to rtph264depay0
或带帽
application/x-rtp\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264\,\ packetization-mode\=\(string\)1\,\ payload\=\(int\)96\,\ a-framerate\=\(string\)25
错误是:
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
错误消息没有上限:
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/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)NULL;
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0: No RTP format was negotiated.
Additional debug info:
gstrtpbasedepayload.c(484): gst_rtp_base_depayload_handle_buffer (): /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0:
Input buffers need to have RTP caps set on them. This is usually achieved by setting the 'caps' property of the upstream source element (often udpsrc or appsrc), or by putting a capsfilter element before the depayloader and setting the 'caps' property on that. Also see http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/README
Execution ended after 0:00:00.006279687
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
答案 0 :(得分:0)
从网上更改源视频解决了上限协商问题。最后的管道是:
v4l2src ! videoscale ! video/x-raw,width=1600,height=1150 ! x264enc tune=zerolatency ! rtph264pay ! udpsink host=192.168.0.100 port=5000
和
udpsrc port=5000 caps = "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96" ! rtph264depay ! avdec_h264 ! autovideosink
以为,更大的分辨率会让应用程序崩溃。