RTMPSrc到v4l2sink

时间:2015-01-28 17:23:33

标签: gstreamer

我想收到一个rtmp-stream并创建一个以v4l2sink作为输出的管道

 gst-launch rtmpsrc location="rtmp://localhost/live/test" ! "video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)YUY2" ! videorate ! v4l2sink device=/dev/video1

但我只得到一个绿屏:https://www.dropbox.com/s/yq9oqi9m62c5afo/screencast1422465570.webm?dl=0

2 个答案:

答案 0 :(得分:0)

您的管道告诉GStreamer将编码的,复用的RTMP数据视为YUV视频缓冲区。

相反,您需要解析,解复用和解码RTMP数据的视频部分。我没有要测试的样本流,但您可能只能使用decodebin(无论出于何种原因,在GStreamer 0.10中称为decodebin2)。您还需要将视频速率重新排序为帧速率上限之前,因此它知道要转换为的内容。

黑暗中的狂野刺伤:

gst-launch rtmpsrc location="rtmp://localhost/live/test" ! decodebin2 ! videoscale ! ffmpegcolorspace ! videorate ! "video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)YUY2" ! v4l2sink device=/dev/video1

答案 1 :(得分:0)

现在有效:

gst-launch rtmpsrc location="rtmp://localhost/live/test" ! decodebin2 ! videoscale ! ffmpegcolorspace ! videorate ! "video/x-raw-yuv,width=1920,height=1080,framerate=30/1,format=(fourcc)YUY2" ! v4l2sink device=/dev/video1
相关问题