Gstreamer RTMPSrc至v4l2sink

Gstreamer RTMPSrc至v4l2sink,gstreamer,Gstreamer,我想接收一个rtmp流并创建一个输出为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 但我只看到了一个绿色屏幕:您的管道正在告诉GStreamer将编码的、多路复用的RT

我想接收一个rtmp流并创建一个输出为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

但我只看到了一个绿色屏幕:

您的管道正在告诉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
现在它可以工作了:

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

你在哪个站台上跑步?您是否安装了h264解码器?运行gst inspect | grep 264并报告您拥有的内容。您需要进入包管理器,查看是否缺少任何gstreamer包。可能与libav或ffmpeg有关。可能是gstreamer0.10-ffmpeg。您没有安装h264视频解码器。我已经安装了所有gstreamer插件和所有libavcodec,但错误仍然存在。如果我安装了gstreamer0.10-ffmpeg,则表示没有安装候选。基本操作系统基于Ubuntu14.10I,我不知道这两个版本中会包含什么包,或者他们出于某种原因决定不包含它。