Compress H264 Stream Using Gstreamer

I am trying to create a GStreamer pipeline ( v 1.0 ) in order to record and play special file format.

For recording purpose I use the following pipeline:

gst-launch-1.0 videotestsrc ! video/x-raw-yuv, format=(fourcc)I420,  width=640, height=480 ! videoconvert ! x264enc byte-stream=1 ! queue ! appsink

In appsink (using new_sample() callback) I use a compression method to compress H264 stream and finally store in a output file.

I use the following pipeline to play the recorded file:

gst-launch-1.0 appsrc ! video/x-h264 ! avdec_h264 ! autovideosink

In appsrc I decompress H264 stream and send it to appsrc buffer (using push-buffer). The size of each buffer is 4095.

Unfortunately GStreamer after push 2 buffers print the following debug message:

Error: Internal data flow error.

Is there any way to fix the problem?


  • Add legacyh264parse or h264parse (depending on your version of gst components) before your decoder. You need to be able to send full frames to the decoder.

  • Post avdec_h264 it would be nice to have a ffmpegcolorspace to be able to convert the video format to your display requirements.

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

    上一篇: 是否有OpenCV版本链接到GStreamer 1.0?

    下一篇: 使用Gstreamer压缩H264流