From patchwork Tue Jan 18 23:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 33652 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4236583iog; Tue, 18 Jan 2022 15:33:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQgnnafIwcoPhaBgAgO0uEUrZF/dS3hY2P7nw4013IWBAvGDaWBNHqJ/j7Uy7C8mIByW3v X-Received: by 2002:a05:6402:50d3:: with SMTP id h19mr13339342edb.346.1642548809662; Tue, 18 Jan 2022 15:33:29 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h8si4021063ejj.762.2022.01.18.15.33.29; Tue, 18 Jan 2022 15:33:29 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b="f57k/Bil"; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A4CFD68B168; Wed, 19 Jan 2022 01:33:16 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067031.outbound.protection.outlook.com [40.92.67.31]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 31CF968B124 for ; Wed, 19 Jan 2022 01:33:10 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BrfuopW+QMHN6dcQ8O77LFgm570vTU64OvNmGPqO+U2rsM3/5UZbcRQgGykWAXaw8OHrH66JSurjEsJjclkE+LoK8L7R4zTX5Um/xkBkwQljPZjkRrWtgwIAK9YA8llXbuZAQOgHLiyaS2MsspSK/zlKOtlT4SpluW3maSaFA0dZPooSmD6YIRsn/l7xmsWFWVMEXsWOxKFTJwfqwM+uJlG2as5jCxpjlD6sd79CcgBJKsmamMgPN9yAg1Rf2sU7BKZW7E1o38tWr+tHtUuCAtIwb2TeGzrB+cMIIhegUBqX4VhSwRgzFJrJhr1nsv68TobxdaPJYblSRjkSsZuiWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=udNGc7r1grgcX84P8DKy++hR9PvD1BkTbuE2ssZ0nIc=; b=GLxNIoGY/RgiQ6foA2TVy4OvDBMm8eo5loI/yvqmIkAvsPsyjbG4ghkMTEYINEI+FE3ujSJcf8MX85KwSaj8pNQGGtoYVN/VrTqNVlsv0hVXtnqF2KQYAmuPe39nfFV/dpmvBwmGiZTAOOdiTTpz7bGoOVwC+xBFq5pcd3+nMbe0uYfzb3aqShg3M2XTqH/7c+TlowP7MFRNDb15t08ysEmfS+zgQT1QLUkeI1rx4W3c5XKismKzSenHWEUHEoR9p8gILYZB4adGIY9NFpSnO81sNnwj5CwKSXRs4jqRq1ueyYVDe1cjpr0tejeIn5455KhZMcqcScOzsP1jLGXFqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=udNGc7r1grgcX84P8DKy++hR9PvD1BkTbuE2ssZ0nIc=; b=f57k/BilGPa/o9OI/Ydr10cWJYvzBCtpRZM3dSU/vudiBHvLlUDcVBaZOOzlJMUGeYWmSo8Fv2yBocMEZ7Acqa3HiGcEyFhZf3GIUhg17kb9WKBj4y+FsDCYtufZnb5bKqfoa7Uq7kuSuHSVIkkkvDqh88oNTUzp6tlc/2C1Tfy/4FGQW8rZbGp4+bgVGJ279cNs+t3lQENXOpUx9etF8pFZZ+IvHJpIjJeTI7x6Q5aNXLG1SKefMh2IGwUdVP36Zwz9UB3BRY6XDMdKCjKLk9s3vGZzaCLjw5sBCsguDn4rQiY+wGjM/1s2Qk72lmq7PP1yVEEIEsrfOA1bYR3kMA== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM0PR03MB4529.eurprd03.prod.outlook.com (2603:10a6:208:c4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Tue, 18 Jan 2022 23:33:04 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::19fc:be9f:2c9c:53f5]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::19fc:be9f:2c9c:53f5%9]) with mapi id 15.20.4909.007; Tue, 18 Jan 2022 23:33:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Jan 2022 00:32:28 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [0WbKcANMsWV+kqFS/t8ha1pfjgmgUqKM] X-ClientProxiedBy: FR3P281CA0044.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::7) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20220118233230.743570-4-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e27b2c09-2ae5-4789-9a7a-08d9dadae00f X-MS-Exchange-SLBlob-MailProps: S/btQ8cKWiTy/gRYuf0ZoZ8SwmTovZBiVXAz8MK2D+PXvk1kVGwht3rDlC0wWyOWtpbUOCNSheIHGCuxqVjd+ykk3Z1KFlMryYHISCSWjKlYNPLG3S7pSCQm6nxJ1TRCUfgSd1b6JhoV8bPRqWWkBKHr3byeJH3gQ4WGR8MLER9Kww1tg+Xp2jv2EsE1p3/A53GnSzFl3nzZZhH6XZ4I1tbtHIfL8ZloqtaV8VeYkAEa7877X18EH4+lvmLYY/vePqSvXKc7vFeHWIvquVVIWYwNsRLSe04LA8qtGG41P65q3UzvXv+cSmjAffFYhCwV6UuNltDwFYDrIT+2GnD064eiFOalstB+17PU7/ntRf4ZfuMg6R2/9Lgs1co0DbSvz5iafwsotH3/rqzCj4AJkE0y5wgD3kHlw5ew5xjG91Le0dJX+hkNA22SOWwM8J/zYvExmFN0qoIi8/YurbJq4utzN8OggGEZA3eD3sepViU0hkL/HmIljS75ufTx82/LVZymYUYNabzV0IUZKwkGZ+N9q8jzYG6pWVKCzf8kYQXmEOFqme1eT2HmOqmiiDuXagc98IvMb+KiACjcANhifhCYi9RWgRITRgAtRYERv5xs3fM7brCrEZeXM86vwhPDTedx0Uh66rhZ77w+8MojifQySSHK4uarbWZAn2Jc1PSkC4EgOXJxGWFEWv2Mbk4CgCebt2Qf34nb42A8hfXnCMxKKmIjwNo5qNWsPWsIzYBk8IKqdGtw/TUo65bfPbikMwCbnSt4tYE= X-MS-TrafficTypeDiagnostic: AM0PR03MB4529:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4QvZCj3zR2Sn9HEY8UZqJIlWslYwjJ1x+xo5Q1U9dZs8+Sn0cNMlkcFCJufUVU+0KjND7H1ge0HDIZenfVFR+u3L1XomRJYG5d04aeeyzkaEusG3j1Xo5WdePq4Sn/MDSlXrjrtbll0+jlAVcgQs+9eaiHbMfT/dTM4AvQWgB0geNbN/prInK5O6MS+yBnNiwChO43vJ9g3Yczcjle01gym2neggO5vFAxf3BcFNToBNZGAkzn1q+LtbEUzfbZ1x2utjrG90SEiWBjRnkqEP9UvgbysObJLQ7L11TA9nvhifigx7ZFKHe6l+iCcMRc32P3Jtw/i266ywRAA5wbCpRa2b8xJHBirzBExSsQwZ4ZKY3o82hrs6x6P3ZA5synca2Z+Nf8gejFY2Ebc4ZVbXPrnxdfzgZpH3U9FDJ7/J6xIEwV4qmxMb6dgM1TsY8wHAI/4AnlLHTlttuCv06Ra8WRxjaMV2BeQ2A3qL9+GA9B5NV2c2p2MzrQ9bR0CCdKSvlQ2FEDCyCt9dOHO1KidRJNIUNjjIim2z/034gW0CmECWTk+LxeICMnZLoO44aRGJVeZYHTmjQrSm/DFN+u7KZw== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uCrmfq5Koeuyuv0/NPFHKJjtt8r9PQKtiq7zm7ZlR+s0CK04qCSvBSJ0jaPy64ONEb0LJ/YZ61hIZDad+LbUOke52Kojl1I8tw2XsWzrII+51DABZo6wkWGb2NDmJPP/K5GOm3hh2NVtytG0N1P01MwNeQKd3oYIiITMCfhIZHyHrUy1jyKU6yo4DxqD1Y3E8aKSoYafvTSpFSKDsg5IvYmauUfV0i4trTliYFnoU//ZVNtHxoo/tTbJ71n3pQYvfm5g5CweXoswqNHXmxTHh+JynTpS13Nj4aFztrEaXTSlxOazcydMFtPSssAWFOBG5eaxWjOd3/AN6B3Qq20wQOW/FGuvwU4O+0F1EbpxWw5gVxIguC2pvED9Jmp600HYtbmjsDMx3BEQdCi6HoBg+DI1/PfpN8F+OpVcfsWa15PTaneMEfqQJAlokVF28pAxph8e9MFsr2kdhsy7Ck7/6A/JGsGRtVd58Ayq53McNfQVpUTsDLEBY6n6CStezDySb78t1aMacgJY5hrFd5auaweFdWjqK/I+Dyx47XSeYta1iqll+oPhB+BEE7Sd43jHtiJ/VczKbzQw+h8rsjKJJyrfjQfNXTErhlskCPfoRG1OjUW7RFa9JpzPQI06nTNOoj7Igp0V0aZGuw29ZrGNOKhjYx0LB9ubUOMyUG1Yxbs3gHsAqDnEDQnX0kmxZH1ciE6307z5A3OimrRe1tawAHUwlLOM+npmqh+yiYhWYoCO+T7VLKUoM0lmviarDfViKB2Go7I3JC4+ib0OAGaBvaOP9eTvF/dCrbXmh3HOtV77Rjld867ujNLbuIrK328AIfiDDGUqHPmSeZK99NvA4YCNDVxsFMMDbXez9Wq2em8wxv8iEUn+Xw/jtfkzHknbY9XvIj0Ycv96GOTaHlaN4FK2zxifp2skWlBcPRNvFdfCsGIvFPpV2gcrfvGIvx3HWCeStAH6v/CIEmWR0Lzr/A== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e27b2c09-2ae5-4789-9a7a-08d9dadae00f X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2022 23:33:04.8055 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB4529 Subject: [FFmpeg-devel] [PATCH 29/31] avformat/mux: Preserve sync even if later packet has negative ts X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: eyZ41PRjnkox write_packet() has code to shift the packets timestamps to make them nonnegative or even make them start at ts zero; this code inspects every packet that is written and if a packet with negative timestamp (whether this is dts or pts depends upon another flag; basically: Matroska uses pts, everyone else dts) is encountered, this is offset to make the timestamp zero. All further packets will be offset accordingly (with the offset converted according to the streams' timebases). This is based around an assumption, namely that the timestamps are indeed non-decreasing, so that the first packet with negative timestamps is the first packet with timestamps. This assumption is often fulfilled given that the default interleavement function by default interleaves per dts; yet there are scenarios in which it may not be fulfilled: a) av_write_frame() instead of av_interleaved_write_frame() is used. b) The audio_preload option is used. c) When the timestamps that are made nonnegative/zero are pts (i.e. with Matroska), because the packet with the smallest dts is not necessarily the packet with the smallest pts. d) Possibly with custom interleavement functions. In these cases the relative sync of the first few packet(s) is offset relative to the later packets. This contradicts the documentation ("When shifting is enabled, all output timestamps are shifted by the same amount"). Therefore this commit changes this: As soon as the first packet with valid timestamps is output, it is checked and recorded whether the timestamps need to be shifted. Further packets are no longer checked for needing to be offset; instead they are simply offset. In the cases above this leads to packets with negative timestamps (and the appropriate warnings) instead of desync. This will mostly be fixed in the next commit. This commit also factors handling the avoid_negative_ts stuff out of write_packet() in order to be able to return immediately. Tickets #4536 and #5784 as well as the matroska-avoid-negative-ts-test are examples of c); as has been said, some timestamps are now negative, yet the ref file update does not show it because ffmpeg.c sanitizes the timestamps (-copyts disables it; ffprobe and mkvinfo also show the original timestamps). Signed-off-by: Andreas Rheinhardt --- libavformat/internal.h | 23 +++-- libavformat/mux.c | 111 +++++++++++++--------- libavformat/options.c | 1 - tests/fate/matroska.mak | 4 +- tests/ref/fate/matroska-avoid-negative-ts | 52 +++++----- 5 files changed, 104 insertions(+), 87 deletions(-) diff --git a/libavformat/internal.h b/libavformat/internal.h index bffb8e66ff..f24c68703f 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -82,6 +82,17 @@ typedef struct FFFormatContext { */ int nb_interleaved_streams; + /** + * Whether the timestamp shift offset has already been determined. + * -1: disabled, 0: not yet determined, 1: determined. + */ + enum { + AVOID_NEGATIVE_TS_DISABLED = -1, + AVOID_NEGATIVE_TS_UNKNOWN = 0, + AVOID_NEGATIVE_TS_KNOWN = 1, + } avoid_negative_ts_status; +#define AVOID_NEGATIVE_TS_ENABLED(status) ((status) >= 0) + /** * The interleavement function in use. Always set for muxers. */ @@ -135,18 +146,6 @@ typedef struct FFFormatContext { */ int raw_packet_buffer_size; - /** - * Offset to remap timestamps to be non-negative. - * Expressed in timebase units. - * @see AVStream.mux_ts_offset - */ - int64_t offset; - - /** - * Timebase for the timestamp offset. - */ - AVRational offset_timebase; - #if FF_API_COMPUTE_PKT_FIELDS2 int missing_ts_warning; #endif diff --git a/libavformat/mux.c b/libavformat/mux.c index a1917878a5..0810b674a7 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -388,6 +388,8 @@ fail: static int init_pts(AVFormatContext *s) { + FFFormatContext *const si = ffformatcontext(s); + /* init PTS generation */ for (unsigned i = 0; i < s->nb_streams; i++) { AVStream *const st = s->streams[i]; @@ -418,13 +420,16 @@ static int init_pts(AVFormatContext *s) } } + si->avoid_negative_ts_status = AVOID_NEGATIVE_TS_UNKNOWN; if (s->avoid_negative_ts < 0) { av_assert2(s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_AUTO); if (s->oformat->flags & (AVFMT_TS_NEGATIVE | AVFMT_NOTIMESTAMPS)) { s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_DISABLED; + si->avoid_negative_ts_status = AVOID_NEGATIVE_TS_DISABLED; } else s->avoid_negative_ts = AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE; - } + } else if (s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_DISABLED) + si->avoid_negative_ts_status = AVOID_NEGATIVE_TS_DISABLED; return 0; } @@ -638,6 +643,64 @@ static void guess_pkt_duration(AVFormatContext *s, AVStream *st, AVPacket *pkt) } } +static void handle_avoid_negative_ts(FFFormatContext *si, FFStream *sti, + AVPacket *pkt) +{ + AVFormatContext *const s = &si->pub; + int64_t offset; + + if (!AVOID_NEGATIVE_TS_ENABLED(si->avoid_negative_ts_status)) + return; + + if (si->avoid_negative_ts_status == AVOID_NEGATIVE_TS_UNKNOWN) { + int use_pts = si->avoid_negative_ts_use_pts; + int64_t ts = use_pts ? pkt->pts : pkt->dts; + + if (ts == AV_NOPTS_VALUE) + return; + if (ts < 0 || + ts > 0 && s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO) { + for (unsigned i = 0; i < s->nb_streams; i++) { + AVStream *const st2 = s->streams[i]; + FFStream *const sti2 = ffstream(st2); + sti2->mux_ts_offset = av_rescale_q_rnd(-ts, + sti->pub.time_base, + st2->time_base, + AV_ROUND_UP); + } + } + si->avoid_negative_ts_status = AVOID_NEGATIVE_TS_KNOWN; + } + + offset = sti->mux_ts_offset; + + if (pkt->dts != AV_NOPTS_VALUE) + pkt->dts += offset; + if (pkt->pts != AV_NOPTS_VALUE) + pkt->pts += offset; + + if (si->avoid_negative_ts_use_pts) { + if (pkt->pts != AV_NOPTS_VALUE && pkt->pts < 0) { + av_log(s, AV_LOG_WARNING, "failed to avoid negative " + "pts %s in stream %d.\n" + "Try -avoid_negative_ts 1 as a possible workaround.\n", + av_ts2str(pkt->pts), + pkt->stream_index + ); + } + } else { + if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) { + av_log(s, AV_LOG_WARNING, + "Packets poorly interleaved, failed to avoid negative " + "timestamp %s in stream %d.\n" + "Try -max_interleave_delta 0 as a possible workaround.\n", + av_ts2str(pkt->dts), + pkt->stream_index + ); + } + } +} + /** * Shift timestamps and call muxer; the original pts/dts are not kept. * @@ -663,51 +726,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) if (pkt->pts != AV_NOPTS_VALUE) pkt->pts += offset; } - - if (s->avoid_negative_ts > 0) { - int64_t offset = sti->mux_ts_offset; - int64_t ts = si->avoid_negative_ts_use_pts ? pkt->pts : pkt->dts; - - if (si->offset == AV_NOPTS_VALUE && ts != AV_NOPTS_VALUE && - (ts < 0 || s->avoid_negative_ts == AVFMT_AVOID_NEG_TS_MAKE_ZERO)) { - si->offset = -ts; - si->offset_timebase = st->time_base; - } - - if (si->offset != AV_NOPTS_VALUE && !offset) { - offset = sti->mux_ts_offset = - av_rescale_q_rnd(si->offset, - si->offset_timebase, - st->time_base, - AV_ROUND_UP); - } - - if (pkt->dts != AV_NOPTS_VALUE) - pkt->dts += offset; - if (pkt->pts != AV_NOPTS_VALUE) - pkt->pts += offset; - - if (si->avoid_negative_ts_use_pts) { - if (pkt->pts != AV_NOPTS_VALUE && pkt->pts < 0) { - av_log(s, AV_LOG_WARNING, "failed to avoid negative " - "pts %s in stream %d.\n" - "Try -avoid_negative_ts 1 as a possible workaround.\n", - av_ts2str(pkt->pts), - pkt->stream_index - ); - } - } else { - if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) { - av_log(s, AV_LOG_WARNING, - "Packets poorly interleaved, failed to avoid negative " - "timestamp %s in stream %d.\n" - "Try -max_interleave_delta 0 as a possible workaround.\n", - av_ts2str(pkt->dts), - pkt->stream_index - ); - } - } - } + handle_avoid_negative_ts(si, sti, pkt); if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) { AVFrame **frame = (AVFrame **)pkt->data; diff --git a/libavformat/options.c b/libavformat/options.c index 1634388acb..2d55d3ad6e 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -174,7 +174,6 @@ AVFormatContext *avformat_alloc_context(void) return NULL; } - si->offset = AV_NOPTS_VALUE; si->shortest_end = AV_NOPTS_VALUE; return s; diff --git a/tests/fate/matroska.mak b/tests/fate/matroska.mak index 3bc35d0f4c..3d8110a434 100644 --- a/tests/fate/matroska.mak +++ b/tests/fate/matroska.mak @@ -94,8 +94,8 @@ fate-matroska-dovi-write-config7: CMD = transcode mov $(TARGET_SAMPLES)/mov/dovi # the first packet (with the overall lowest dts) is a video packet, # whereas an audio packet to be muxed later has the overall lowest pts # which happens to be negative and therefore needs to be shifted. -# This is currently buggy (the timestamps of the video frames muxed -# before the first audio frame are not shifted). +# This is currently buggy (the timestamps are not shifted properly: +# the first audio packet has negative timestamps). # Also tests muxing DOVI. FATE_MATROSKA_FFMPEG_FFPROBE-$(call ALLYES, FILE_PROTOCOL MOV_DEMUXER \ AAC_FIXED_DECODER HEVC_DECODER \ diff --git a/tests/ref/fate/matroska-avoid-negative-ts b/tests/ref/fate/matroska-avoid-negative-ts index 9c23f4721c..5bc71c76f7 100644 --- a/tests/ref/fate/matroska-avoid-negative-ts +++ b/tests/ref/fate/matroska-avoid-negative-ts @@ -1,4 +1,4 @@ -6048ff1b45660eb544c1f0db450afff5 *tests/data/fate/matroska-avoid-negative-ts.matroska +e31928477981a8ffad351379f6d5f14a *tests/data/fate/matroska-avoid-negative-ts.matroska 3618353 tests/data/fate/matroska-avoid-negative-ts.matroska #extradata 0: 551, 0xa18acf66 #tb 0: 1/1000 @@ -12,32 +12,32 @@ #sample_rate 1: 44100 #channel_layout 1: 3 #channel_layout_name 1: stereo -0, -67, 0, 33, 63375, 0xc76606ab, S=1, 8 -0, -34, 133, 33, 46706, 0x0e08a7e5, F=0x0 -0, 0, 73, 33, 29766, 0x753c031a, F=0x0 +0, -62, 5, 33, 63375, 0xc76606ab, S=1, 8 +0, -29, 138, 33, 46706, 0x0e08a7e5, F=0x0 1, 0, 0, 34, 834, 0x7e7776bd -1, 35, 35, 34, 836, 0x14a3a0ff -0, 39, 39, 33, 19409, 0x4b948b6c, F=0x0 -1, 70, 70, 34, 836, 0xf55e9a61 -0, 73, 106, 33, 21086, 0x1b9412ce, F=0x0 -1, 105, 105, 34, 836, 0x415591f1 -0, 106, 273, 33, 62043, 0xc2356b56, F=0x0 -0, 133, 206, 33, 36175, 0x0a7df38c, F=0x0 -1, 140, 140, 34, 836, 0xe26c9bad -0, 173, 173, 33, 16028, 0xa57fcbe9, F=0x0 -1, 174, 174, 34, 836, 0xbc8c9b66 -0, 206, 239, 33, 15428, 0x9a91f357, F=0x0 -1, 209, 209, 34, 836, 0xddeb9643 -0, 239, 406, 33, 66072, 0xa542b6d7, F=0x0 -1, 244, 244, 34, 836, 0x08a494eb -0, 273, 339, 33, 34985, 0xbfd8ff45, F=0x0 -1, 279, 279, 34, 836, 0x94f09bb4 -0, 306, 306, 33, 16036, 0xfc39c6ea, F=0x0 -1, 314, 314, 34, 836, 0xd6358a3a -0, 339, 373, 33, 19893, 0x7e746f4e, F=0x0 -1, 348, 348, 34, 836, 0x76ac91f1 -0, 373, 539, 33, 77576, 0xeba2e5c8, F=0x0 -1, 383, 383, 34, 836, 0xb32a86ac +0, 5, 72, 33, 29766, 0x753c031a, F=0x0 +1, 34, 34, 34, 836, 0x14a3a0ff +0, 38, 38, 33, 19409, 0x4b948b6c, F=0x0 +1, 69, 69, 34, 836, 0xf55e9a61 +0, 72, 105, 33, 21086, 0x1b9412ce, F=0x0 +1, 104, 104, 34, 836, 0x415591f1 +0, 105, 272, 33, 62043, 0xc2356b56, F=0x0 +0, 138, 205, 33, 36175, 0x0a7df38c, F=0x0 +1, 139, 139, 34, 836, 0xe26c9bad +0, 172, 172, 33, 16028, 0xa57fcbe9, F=0x0 +1, 173, 173, 34, 836, 0xbc8c9b66 +0, 205, 238, 33, 15428, 0x9a91f357, F=0x0 +1, 208, 208, 34, 836, 0xddeb9643 +0, 238, 405, 33, 66072, 0xa542b6d7, F=0x0 +1, 243, 243, 34, 836, 0x08a494eb +0, 272, 338, 33, 34985, 0xbfd8ff45, F=0x0 +1, 278, 278, 34, 836, 0x94f09bb4 +0, 305, 305, 33, 16036, 0xfc39c6ea, F=0x0 +1, 313, 313, 34, 836, 0xd6358a3a +0, 338, 372, 33, 19893, 0x7e746f4e, F=0x0 +1, 347, 347, 34, 836, 0x76ac91f1 +0, 372, 538, 33, 77576, 0xeba2e5c8, F=0x0 +1, 382, 382, 34, 836, 0xb32a86ac [STREAM] [SIDE_DATA] side_data_type=DOVI configuration record