streaming h.264 video Using gstreamer

I am trying to stream a h265 encoded video using gstreamer. I am using the command

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

i am getting this

WARNING: erroneous pipeline: could not link h264parse0 to ffmpegcsp0

what mistake i have to overcome

and why

ffdec_h264

i couldn't able to find

Getting the error if try this

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 ...

First I suppose this is a typo :

I am trying to stream a h265 video

right ?

Second you should use uridecodebin for that usecase :

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

The actual problem with your launch line is that h264parse outputs h264 material (video/x-h264), which still has to be properly decoded into video/x-raw by the decoder of your choice.

Something that should work with 0.10 :

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

decodebin takes care of that for you, so you'll be better off using it.


Why don't you use playbin2?

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

If for some reason you want to use uridecodebin, the problem is that you are getting a 'not-negotiated' error. This means that the data produced by uridecodebin isn't directly accepted by your sink (in this case).

I'd recommending using:

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

The second ffmpegcolorspace might not be needed. Playbin2 already handles all of this to you.

链接地址: http://www.djcxy.com/p/43982.html

上一篇: 使用gstreamer流式传输音频和视频

下一篇: 流媒体h.264视频使用gstreamer