From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 6C69345DA1 for ; Mon, 10 Apr 2023 12:43:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2D53968B0B6; Mon, 10 Apr 2023 15:43:49 +0300 (EEST) Received: from out203-205-251-59.mail.qq.com (out203-205-251-59.mail.qq.com [203.205.251.59]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F01AB68B0B6 for ; Mon, 10 Apr 2023 15:43:40 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1681130611; bh=pHyXJakGdX5OPoJRx+5IXkpxLwBHWzqvdpBA4ucukOk=; h=From:To:Cc:Subject:Date; b=b1cguXxGDd5Z7+Z1StplduAl8YqLLylPaoSmAWsxZsDvzOpa28yTGhSYqjj1snWdk yqwO1Qh+arhB1zYqQERygQDO6s7XugxpmLRHhh1gNYZIhmCRYZVcVyx7d+k8nNGQ2l QleBOgQLysMlY/FJTY2/1c4XBzCNFtrBc1tH/yQM= Received: from localhost.localdomain ([103.107.217.227]) by newxmesmtplogicsvrszb1-0.qq.com (NewEsmtp) with SMTP id ADD1BCEA; Mon, 10 Apr 2023 20:43:29 +0800 X-QQ-mid: xmsmtpt1681130609ty40mziy7 Message-ID: X-QQ-XMAILINFO: NJ/+omVLhVgap9q/O79/QOz1PNQFTrdVjD0aTaTHa1zzXjB5AjkOHto/mApj51 A9XLCAT6qpFixoKSbYWDs1D4EYqpfZoO4akIfJlV4Y22CvlZo17NwfSXOkyiviKAp56VrUH6mf7b i7KdpuOdqHLWGGNcxk4+9xq8HgjgUkccDADvMEXycIln4OoTMgm6do/9AjElbb4zQ+e/ZbyIFoPc XySzRik8BxvPYgRR7I9xRrURgHk2V69OR87kpTiDoZhWyIbo1onyzvvBRwxonsm4MaMwyd7XxEjA 50zoDEJOqvfBH/g2K2wQJR4WHyiGmdcU7s8pXdMmYxitlB9Mf9D7gxtpDUDuPxfGPlz45A1HY+NZ cQ210ZX1MmlrwHW8aTBAvqJNPF1ptsVNkCFbtLzOevYYlOWmF6WCMxKYnLjGAJi19jjqrXP0l83X clAAMQzCficAS61V95mCKtUuFHYs65yt8HDpZpZ0W2+jw94MAKg5vfYZWhK0cJKjn8RA7B5d7bWl jvu+8+JkS+soXSopq9cxiXa6GCSnUCYInfPOHjAdtT/uwXQGnxsOs2Y5BRC+WHMCUxaqJ3LUPKsE VTz4WqO8Ko+qEPi1Ll5REtDg657NjSBiDVJ2eYMQSDRSExXLVnw/KnFukiTIdVmR9ypkheLRkMHP YnKPEL+ZRh08vQgsGsRfjM2xYnL5nzuQKH92ltAf5X6OrjnwAgxMJ8aXW6Rncbq4iQagC/wunVHG +D56MF0eWHHvd1NKGnPZjIaB9ENYk3xfYEq1F+lldJBNiMdIR5HZYJx2KXGapl+FAXCw9joaQ9Su +Qa0VnHS8AB08x4texucTCNiViziVDosMluWbEH2uNXEdCiWoQRjp71hL2GpK+7PPoCLJG3iT1hN WdI/ReFFNaA5UcB+9JuFfskj3xSfiYq0oErxC/eAcmjl88YigmQEobBbeVlU6zBQsguXXIA6ze From: 1035567130@qq.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Apr 2023 20:43:26 +0800 X-OQ-MSGID: <20230410124326.98616-1-1035567130@qq.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: fixed fmp4 packets containing incorrect flags after transcoding 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: Wang Yaqiang 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: From: Wang Yaqiang When write multi-trun box, the MOV_TRUN_FIRST_SAMPLE_FLAGS flag need judge by first param, not 0. If the original video contains consecutive I frames, this will cause the packets of fmp4 have error sample_flags , and then incorrect keyframes were generated, and then error packet will be seeked. Signed-off-by: Wang Yaqiang --- libavformat/movenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index c370922c7d..946e79c5ac 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4858,8 +4858,8 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov, if (i > first && get_sample_flags(track, &track->cluster[i]) != track->default_sample_flags) flags |= MOV_TRUN_SAMPLE_FLAGS; } - if (!(flags & MOV_TRUN_SAMPLE_FLAGS) && track->entry > 0 && - get_sample_flags(track, &track->cluster[0]) != track->default_sample_flags) + if (!(flags & MOV_TRUN_SAMPLE_FLAGS) && track->entry > first && + get_sample_flags(track, &track->cluster[first]) != track->default_sample_flags) flags |= MOV_TRUN_FIRST_SAMPLE_FLAGS; if (track->flags & MOV_TRACK_CTTS) flags |= MOV_TRUN_SAMPLE_CTS; -- 2.39.2 _______________________________________________ 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".