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 ECD4540869 for ; Thu, 3 Mar 2022 04:57:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2E3C68AA61; Thu, 3 Mar 2022 06:57:20 +0200 (EET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5644E68A905 for ; Thu, 3 Mar 2022 06:57:14 +0200 (EET) Received: by mail-pj1-f52.google.com with SMTP id g7-20020a17090a708700b001bb78857ccdso6719010pjk.1 for ; Wed, 02 Mar 2022 20:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=5FcJGCnzO/Vsa2sE15KWtML+GwmjUHqyQNzRsbfGBWU=; b=FSrBI59NqyMASCyUTbjk+Wpl+kG8vbVaGme1jvK8Wbd3JzYmPyhyxVnvGqcTrAJrzg t8FKIY1bCH5rRVdEpBg47gqT7ghy4yBkuyLwJaXg5iFGiSIDzA7K2ce+XTSJ0cGHLbT7 k1MdGSMatu3jSPlWlmf17C9AJULIjOqpamdtchJ7fqV/S2pUPLu4fQjiVSt6guqoVZsH bagwty/Q0QRyxoUNEsADwushNsz3vvPHbPVcBMHKuLCEdn0SyAeZfBUk/At0e7d7NuT9 e/odeJIc3TiHNUBxG1a0Y6qmDL2u21c0X4isjRiflw0WVT6cRaGIQk4/FDh3MiK2tnIQ aGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=5FcJGCnzO/Vsa2sE15KWtML+GwmjUHqyQNzRsbfGBWU=; b=wk0ZLVZocEMFEcJ8Z6fn2dLDT+V41J1eqIOZOePhXfHtMDiclDZXK8sLERHDxCT7n5 jFATaFmIHuYuWPe4oGqAkXi6lqhEcCIDZHyB2jXXBx0k5dsRUaP/DX0jb/Skmsx6MwKf mwLBA55QXBOaOBFFDYPS7/KnMgyQGICH0uZ6ZvLv1vSYYsSwpfeHtEABVHQhxwPxaeGl mpOudfD7TS8hcEgrqU2rxXmaplRse6lnyMaj8ENfj7374QeiMXtH474LSZE5HWGiaS9J nnVOT1b1kRJ8Ws4sWFP/5kYHYxbaLfEbqknA235GjTb6P/suZcRxFqMZTOCjXAmJozlV 7akA== X-Gm-Message-State: AOAM532d0WA+FEgnuSgdMYl1Lh0sCjXwfHcpNwCZEI3o0VpnXMbBTgQQ X7VMkRRlswAKuoCcoGaWkwjzbrFi9mg= X-Google-Smtp-Source: ABdhPJx4prVs5gujJ0lo9Kn7zcEjrldebLk/rctjuSgYMg92qosCr/82IvL3Ci/edItHyl+cn4HCPQ== X-Received: by 2002:a17:90a:fd01:b0:1bc:3481:c20 with SMTP id cv1-20020a17090afd0100b001bc34810c20mr3421693pjb.110.1646283431897; Wed, 02 Mar 2022 20:57:11 -0800 (PST) Received: from gmail.com ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id r19-20020a17090aa09300b001bc5fb5886asm6614906pjp.5.2022.03.02.20.57.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Mar 2022 20:57:11 -0800 (PST) Date: Thu, 3 Mar 2022 12:57:08 +0800 From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Message-ID: <20220303045708.GA22849@gmail.com> Mail-Followup-To: ffmpeg-devel@ffmpeg.org References: <1646229512-12103-1-git-send-email-lance.lmwang@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/movenc: initialize pts/dts/duration of timecode packet 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 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: On Thu, Mar 03, 2022 at 02:55:23AM +0100, Andreas Rheinhardt wrote: > lance.lmwang@gmail.com: > > From: Limin Wang > > > > Fix below error message when timecode packet is written. > > "Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format" > > > > try to reproduce by: > > ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov > > > > Note although error message is printed, the timecode packet will be written anyway. So > > the patch 2/2 will try to change the log level to warning. > > > > The first two test case of fate-lavf-ismv have timecode setting, so the crc of ref data is different. > > Fixes ticket #9488 > > > > Signed-off-by: Limin Wang > > --- > > libavformat/movenc.c | 2 ++ > > tests/ref/lavf/ismv | 4 ++-- > > 2 files changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/libavformat/movenc.c b/libavformat/movenc.c > > index 4c86891..74b94cd 100644 > > --- a/libavformat/movenc.c > > +++ b/libavformat/movenc.c > > @@ -6383,6 +6383,8 @@ static int mov_create_timecode_track(AVFormatContext *s, int index, int src_inde > > pkt->data = data; > > pkt->stream_index = index; > > pkt->flags = AV_PKT_FLAG_KEY; > > + pkt->pts = pkt->dts = av_rescale_q(tc.start, av_inv_q(rate), (AVRational){1,mov->movie_timescale}); > > + pkt->duration = av_rescale_q(1, av_inv_q(rate), (AVRational){1,mov->movie_timescale}); > > pkt->size = 4; > > AV_WB32(pkt->data, tc.start); > > ret = ff_mov_write_packet(s, pkt); > > diff --git a/tests/ref/lavf/ismv b/tests/ref/lavf/ismv > > index ac7f72b..723b432 100644 > > --- a/tests/ref/lavf/ismv > > +++ b/tests/ref/lavf/ismv > > @@ -1,7 +1,7 @@ > > -48fb8d7a5d19bd60f3a49ccf4b7d6593 *tests/data/lavf/lavf.ismv > > +7a24b73c096ec0f13f0f7a2d9101c4c1 *tests/data/lavf/lavf.ismv > > 313169 tests/data/lavf/lavf.ismv > > tests/data/lavf/lavf.ismv CRC=0x9d9a638a > > -d19cd8e310a2e94fe0a0d11c5dc29217 *tests/data/lavf/lavf.ismv > > +79646383fd099d45ad0d0c2791c601dd *tests/data/lavf/lavf.ismv > > 322075 tests/data/lavf/lavf.ismv > > tests/data/lavf/lavf.ismv CRC=0xe8130120 > > 3b6023766845b51b075aed474c00f73c *tests/data/lavf/lavf.ismv > > Are the currently created files spec-incompliant? Or will the files > created with this patch be spec-incompliant? I think both the currently created files and after are spec-compliant as the pts/dts isn't used by tmcd track I think. The currently code will trigger below condition as the pts/dts isn't initialized: [ismv @ 0x56c8c40] Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format so the dts and pts will try to set them as the following code: 5640 if (pkt->dts < ref || duration >= INT_MAX) { 5641 av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" / timestamp: %"PRId64" is out of range for mov/mp4 format\n", 5642 duration, pkt->dts 5643 ); 5644 5645 pkt->dts = ref + 1; 5646 pkt->pts = AV_NOPTS_VALUE; 5647 } By the comparing hex string by before and after, one byte is different, but I haven't figured out where is it yet, but it's related pts and dts value. [ffmpeg.git]$ hexdump lavf_before.ismv > lavf_before.log [ffmpeg.git]$ hexdump lavf_after.ismv > lavf_after.log [ffmpeg.git]$ diff lavf_before.log lavf_after.log 8974c8974 < 00230d0 0000 0000 0000 0000 6d0c 6164 0074 0804 --- > 00230d0 0000 0000 0028 0000 6d0c 6164 0074 0804 > > - Andreas > _______________________________________________ > 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". -- Thanks, Limin Wang _______________________________________________ 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".