diff options
author | Mathieu Duponchelle <mathieu@centricular.com> | 2021-08-06 23:36:48 +0200 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-08-20 00:16:43 +0000 |
commit | 896c49cf4959815badcb5dd538a5d522a1f1629e (patch) | |
tree | 4a59f3ae41c9e1577e9e23aa0ec273ecd6937bbb | |
parent | fa835d686f7edbaf9617f496a9fee3132577df42 (diff) | |
download | gstreamer-plugins-good-896c49cf4959815badcb5dd538a5d522a1f1629e.tar.gz |
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1047>
-rw-r--r-- | gst/isomp4/gstqtmux.c | 12 | ||||
-rw-r--r-- | 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 d93d06606..eb55e8059 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 7fa741aad..143b21743 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 |