From 896c49cf4959815badcb5dd538a5d522a1f1629e Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 6 Aug 2021 23:36:48 +0200 Subject: [PATCH] isomp4/qtmux: accept video/x-h264, stream-format=avc3 The main difference between avc1 and avc3 is that avc3 is allowed to contain in-band SPS / PPS. In practice decoders will always use in-band parameter sets anyway, but it is cleaner to explicitly advertise it. Part-of: --- gst/isomp4/gstqtmux.c | 12 +++++++++++- gst/isomp4/gstqtmuxmap.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index d93d066..eb55e80 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -6321,12 +6321,22 @@ gst_qt_mux_video_sink_set_caps (GstQTMuxPad * qtpad, GstCaps * caps) "output might not play in Apple QuickTime (try global-headers?)"); } } else if (strcmp (mimetype, "video/x-h264") == 0) { + const gchar *stream_format; + if (!codec_data) { GST_WARNING_OBJECT (qtmux, "no codec_data in h264 caps"); goto refuse_caps; } - entry.fourcc = FOURCC_avc1; + stream_format = gst_structure_get_string (structure, "stream-format"); + + if (!g_strcmp0 (stream_format, "avc")) { + entry.fourcc = FOURCC_avc1; + } else if (!g_strcmp0 (stream_format, "avc3")) { + entry.fourcc = FOURCC_avc3; + } else { + g_assert_not_reached (); + } ext_atom = build_btrt_extension (0, qtpad->avg_bitrate, qtpad->max_bitrate); if (ext_atom != NULL) diff --git a/gst/isomp4/gstqtmuxmap.c b/gst/isomp4/gstqtmuxmap.c index 7fa741a..143b217 100644 --- a/gst/isomp4/gstqtmuxmap.c +++ b/gst/isomp4/gstqtmuxmap.c @@ -60,7 +60,7 @@ #define H264_CAPS \ "video/x-h264, " \ - "stream-format = (string) avc, " \ + "stream-format = (string) { avc, avc3 }, " \ "alignment = (string) au, " \ COMMON_VIDEO_CAPS -- 2.7.4