From f6c070fbff3c0b323c9fca1c0cf252221f39d7fa Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 2 Mar 2022 16:24:38 -0500 Subject: [PATCH] isomp4: Fix AV1 default alignment ISOMP4 store TU (temporal units) worth of AV1. Expose this in the caps to reduce overhead in the parser, and in the muxer to avoid storing frames split in the wrong way. Part-of: --- subprojects/gst-plugins-good/gst/isomp4/gstqtmuxmap.c | 6 ++++-- subprojects/gst-plugins-good/gst/isomp4/qtdemux.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/isomp4/gstqtmuxmap.c b/subprojects/gst-plugins-good/gst/isomp4/gstqtmuxmap.c index 143b217431..18dbe93392 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/gstqtmuxmap.c +++ b/subprojects/gst-plugins-good/gst/isomp4/gstqtmuxmap.c @@ -205,7 +205,8 @@ GstQTMuxFormatProp gst_qt_mux_format_list[] = { COMMON_VIDEO_CAPS "; " "video/x-dirac, " COMMON_VIDEO_CAPS "; " "video/x-qt-part, " COMMON_VIDEO_CAPS "; " - "video/x-av1, " COMMON_VIDEO_CAPS), + "video/x-av1, " "alignment = (string) \"tu\", " + COMMON_VIDEO_CAPS ";"), GST_STATIC_CAPS (PCM_CAPS_FULL "; " PCM_CAPS_UNPOSITIONED " ; " MP123_CAPS " ; " @@ -229,7 +230,8 @@ GstQTMuxFormatProp gst_qt_mux_format_list[] = { GST_STATIC_CAPS ("video/quicktime, variant = (string) iso"), GST_STATIC_CAPS (MPEG4V_CAPS "; " H264_CAPS ";" H265_CAPS ";" "video/x-mp4-part," COMMON_VIDEO_CAPS "; " - "video/x-av1, " COMMON_VIDEO_CAPS), + "video/x-av1, " "alignment = (string) \"tu\", " + COMMON_VIDEO_CAPS ";"), GST_STATIC_CAPS (MP123_CAPS "; " AAC_CAPS " ; " AC3_CAPS " ; " ALAC_CAPS " ; " OPUS_CAPS), GST_STATIC_CAPS (TEXT_UTF8), diff --git a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c index 8bc9df7a7d..091864b1f8 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c +++ b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c @@ -14749,7 +14749,8 @@ qtdemux_video_caps (GstQTDemux * qtdemux, QtDemuxStream * stream, break; case FOURCC_av01: _codec ("AV1"); - caps = gst_caps_new_empty_simple ("video/x-av1"); + caps = gst_caps_new_simple ("video/x-av1", + "alignment", G_TYPE_STRING, "tu", NULL); break; case GST_MAKE_FOURCC ('k', 'p', 'c', 'd'): default: