From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 9FC114B6B4 for ; Mon, 21 Jul 2025 21:02:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 89E4268CA56; Tue, 22 Jul 2025 00:02:28 +0300 (EEST) Received: from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com [136.143.188.12]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id BA36968C2EF for ; Tue, 22 Jul 2025 00:02:21 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; t=1753131736; cv=none; d=zohomail.com; s=zohoarc; b=OSvSVaJE5xTgMG4mmMsXxzkKqRJv79CudVQCclI0ucMBc9gEsKMO8kQouMLkja9LWjNo27BoUkGylJiNwq47CRB4SAXmk6k0srzhbkajp4nYHdLy7mqKx/oo4DV9EWBo5WZ8mfhLJrCh8/uZS85PCUO31hte1HsFkQUZgORvkXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1753131736; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=KDsa2fMMfBChc70AXxnhCCp3wFaAU505NDah8VQuq9E=; b=GV8p5MiXpxM87fTP0+anzs3jG4g0vS8HPFFXzaAekwU7z3RzvzkWJmSjYNvyMkKYOChrk3ShuX9ci3wlBM2Od2JF40wnu09yZiq12AvdGcaai7ntAwT/2McP1tKyh4uykU2oW1x8JlxTXUmXdyPOh95n+Gza0gEzGu0jKL9R7d8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=mcelroy.online; spf=pass smtp.mailfrom=david@mcelroy.online; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1753131736; s=zoho; d=mcelroy.online; i=david@mcelroy.online; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=KDsa2fMMfBChc70AXxnhCCp3wFaAU505NDah8VQuq9E=; b=m5HCnGmyew9AXoS/qk5bBryEa+uKROj2IuBylxBzXKworSH1OHtzraKz/3uDL1MC xZmkpqxlUZAxD6GR6NY5pe/0VzZhRLrg2Ed9VlTGYpPIX5ObXhEFYnw0A3IRKalawGr AwybkfFZ7Yp3oxq/UXIg9jCpIwZjynAuCZe28DHI= Received: by mx.zohomail.com with SMTPS id 1753131734434958.7588692601357; Mon, 21 Jul 2025 14:02:14 -0700 (PDT) From: David McElroy To: ffmpeg-devel@ffmpeg.org Date: Mon, 21 Jul 2025 17:01:47 -0400 Message-Id: <20250721210147.14457-2-david@mcelroy.online> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250721210147.14457-1-david@mcelroy.online> References: <20250721210147.14457-1-david@mcelroy.online> MIME-Version: 1.0 X-ZohoMailClient: External Subject: [FFmpeg-devel] [PATCH 1/1] avformat/movenc: fix HEVC fmp4 HLS init segment for Apple playback 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: David McElroy , Jay Zhang Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: HEVC fmp4 HLS video produced by ffmpeg is currently unplayable on Apple software (Safari, QuickTime, AVFoundation). This is caused by an empty sdtp atom being erroneously written to the fmp4 init segment. The `has_disposable` flag can be set for a track with B-frames, but the init segment contains no actual frames (track->entry == 0). Writing an sdtp atom in this case is incorrect and causes Apple's parsers to reject the file. This patch fixes the issue by ensuring the sdtp atom is only written if track->entry is non-zero. A similar patch was proposed in November 2023 by Jay Zhang, but it was never merged. Link: https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-November/317173.html Co-authored-by: Jay Zhang Signed-off-by: David McElroy --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8d13ac8..bb0af11 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3273,7 +3273,7 @@ static int mov_write_stbl_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext track->par->codec_tag == MKTAG('r','t','p',' ')) && track->has_keyframes && track->has_keyframes < track->entry) mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE); - if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && track->has_disposable) + if (track->par->codec_type == AVMEDIA_TYPE_VIDEO && track->has_disposable && track->entry) mov_write_sdtp_tag(pb, track); if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS) mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE); -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".