From 61153a5ac231141e4395b9f0bb28a26fa808a098 Mon Sep 17 00:00:00 2001 From: Alex Ashley Date: Fri, 30 Aug 2013 11:48:51 +0100 Subject: [PATCH] avcodecmap: exclude avc3 stream format from AV_CODEC_ID_H264 As part of the changes to support the "avc3" variant of the ISO-BMFF (see bug #702004) a new stream-format has been created (video/x-h264, stream-format="avc3", alignment="au") that requires changes to gstavcodecmap to exclude this format because avdec_h264 expects the SPS and PPS to be in the codec_data. Amendment 2 of ISO/IEC 14496-15 (AVC file format) is defining a new structure for fragmented MP4 called "avc3". The principal difference between AVC1 and AVC3 is the location of the codec initialisation data (e.g. SPS, PPS). In AVC1 this data is placed in the initial MOOV box (moov.trak.mdia.minf.stbl.stsd.avc1) but in AVC3 this data goes in the first sample of every fragment. https://bugzilla.gnome.org/show_bug.cgi?id=702004 --- ext/libav/gstavcodecmap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index 395ea36..1a2f515 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -1142,6 +1142,19 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, caps = gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-h264", "alignment", G_TYPE_STRING, "au", NULL); + if (!encode) { + GValue arr = { 0, }; + GValue item = { 0, }; + g_value_init (&arr, GST_TYPE_LIST); + g_value_init (&item, G_TYPE_STRING); + g_value_set_string (&item, "avc"); + gst_value_list_append_value (&arr, &item); + g_value_set_string (&item, "byte-stream"); + gst_value_list_append_value (&arr, &item); + g_value_unset (&item); + gst_caps_set_value (caps, "stream-format", &arr); + g_value_unset (&arr); + } break; case AV_CODEC_ID_INDEO5: -- 2.7.4