Problems muxing raw h264 stream with qtmux

laena lenaherscheid at gmail.com
Fri Feb 24 05:26:21 PST 2012


Hi all,

I am trying to mux a raw h264 video stream (already encoded) into a
QuickTime file using the following pipeline:
appsrc => qtmux => filesink

The appsrc and qtmux components are connected filtered with the following
caps:
gst_caps_new_simple (
      "video/x-h264",
      "stream-format",  G_TYPE_STRING,      "avc",
      "alignment",      G_TYPE_STRING,      "au",
      "bpp",            G_TYPE_INT,         32,
      "framerate",      GST_TYPE_FRACTION,  1, 5,
      "endianness",     G_TYPE_INT,         4321,
      "width",          G_TYPE_INT,         1280,
      "height",         G_TYPE_INT,         1024, 
      NULL);

The pipeline runs properly without errors. 
The end-of-stream event is also arriving when it should and the container
itself seems valid, because VLC is able to extract aspect ratio and format
information from it.

However, I am not able to play the resulting video file with any media
player I know.

I think the problem might be that I simply push buffer into the appsrc
component with every frame:

GstBuffer* buffer = gst_buffer_new();
gst_buffer_set_caps( buffer, m_caps );
  
GST_BUFFER_MALLOCDATA(buffer) = (guint8*)g_malloc(stream->DataLength);
GST_BUFFER_SIZE(buffer)       = stream->DataLength;
GST_BUFFER_DATA(buffer)       = (guint8*)g_malloc0(stream->DataLength);
  
// Timestamp is important here, else the muxer will exit with an error at
once
GST_BUFFER_TIMESTAMP(buffer)  = stream->TimeStamp;

memcpy( GST_BUFFER_DATA(buffer), stream->Data, stream->DataLength);
GstFlowReturn rtrn = gst_app_src_push_buffer( GST_APP_SRC(m_source), buffer
);

But I never got any appsrc buffer errors in my bus_call function, so I
assumed this would work.

What have I done wrong here? Any ideas are welcome.

Cheers!

--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Problems-muxing-raw-h264-stream-with-qtmux-tp4417169p4417169.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list