流媒体h.264视频使用gstreamer

时间:2013-09-17 14:05:43

标签: ubuntu-12.04 gstreamer

我正在尝试使用gstreamer传输h265编码的视频。我正在使用命令

  

gst-launch-0.10 filesrc location = / home / user / Desktop / sample_mpeg4.mp4! qtdemux! h264parse! video / x-h264! ffmpegcolorspace! deinterlace! xvimagesink *

我得到了这个

  

警告:错误的管道:无法将h264parse0链接到ffmpegcsp0

我必须克服什么错误

以及为什么

  

ffdec_h264

我无法找到

尝试此操作时出现错误

  

gst-launch-0.10 uridecodebin uri = file:///home/user/Desktop/sample_mpeg4.mp4! xvimagesink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
Additional debug info:
qtdemux.c(3891): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstURIDecodeBin:uridecodebin0/GstDecodeBin2:decodebin20/GstQTDemux:qtdemux0:
streaming stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

2 个答案:

答案 0 :(得分:3)

首先我想这是一个错字:

  

我正在尝试播放 h265 视频

对吧?

其次你应该使用uridecodebin作为该用例:

gst-launch uridecodebin uri=file:///home/user/Desktop/sample_mpeg4.mp4 ! xvimagesink

你的发射线的实际问题是h264parse输出h264素材(video / x-h264),它仍然必须由你选择的解码器正确解码为video / x-raw。

适用于0.10的东西:

gst-launch-0.10 filesrc location= /home/user/Desktop/sample_mpeg4.mp4 ! qtdemux ! ffdec_h264 ! autovideosink

decodebin会为您解决这个问题,因此您最好还是使用它。

答案 1 :(得分:1)

为什么不使用playbin2?

gst-launch-0.10 playbin2 uri=file:///path/to/your/file.mp4

如果由于某种原因你想使用uridecodebin,问题是你得到一个'未协商'的错误。这意味着你的接收器不会直接接受uridecodebin生成的数据(在这种情况下)。

我建议使用:

gst-launch-0.10 uridecodebin uri=file:///home/user/Desktop/sample_mpeg4.mp4 ! ffmpegcolorspace ! videoscale ! ffmpegcolorspace ! xvimagesink

可能不需要第二个ffmpegcolorspace。 Playbin2已经为您处理了所有这些。