From patchwork Sat Dec 30 11:30:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 7028 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp11526135jad; Sat, 30 Dec 2017 03:30:17 -0800 (PST) X-Google-Smtp-Source: ACJfBovtRNGEQFbwf9VWayTPT9pgD+/rz7RDoM1AlaMWOazevIh57GsY+upCvmjmQ8ocOx3TIddi X-Received: by 10.223.186.13 with SMTP id o13mr6980903wrg.43.1514633417690; Sat, 30 Dec 2017 03:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514633417; cv=none; d=google.com; s=arc-20160816; b=anXT6Ufd/UsDfxJ4+u+zeOkVuL7/tLe/0GlC8rZG5r00YDYtfD/nbh0aO4iUjAAtEl W0gCdNM5N9zkLsi6TSmjWIEXSIsm+I0i5EefQzrHbwsNQbqgo8DFxCh+34F0Mq3XtMSu I8ed1+CPYVe824Y67P2j/4yWd1YMBhCxBEn5TxEoJO5PgfVYbblMhfNuZW7rEsNzZNCJ yJ8ry17OSB0iZh4jmJJNnTl1ZJRydt7wxQx+/t9y54poubTHtHmTGHvK2UnZG4TaRn4+ Eo5bohGOgdhJPUY/ChWJ7g1a74WCf3ERnPJeiwHfLo6W4gPOZhgFErJhIMlCN3b+6f53 8tpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :in-reply-to:mime-version:references:message-id:to:from:date :delivered-to:arc-authentication-results; bh=A8HJl1H3ntNgm/DOzIApmEGRdm/ovFPjiGkEvaxL1cw=; b=edBLEbgbpkbXSKYkTP3I6fmtQHFR+JGqZiW/NMir8hPn+pfrLFwP/j+IxxsdbATObw pasY1Fxtl41XwNCPmysSkp5zvdWr/byo6fV6TolFl4mei6NsJ/VF7abIZ/agnwvWgoJR AR6MIyA2gcXNRW2xIPjLkYgMiQ6B/D+x/w6QrgnFZuj8z7LPO43EVanyJgayvZS/0WuW xa+wg1NPY52TQ/fhKCe2FETDTYE8Z/6mZLXY2AbLGzwYICfpvkbhKHkke1FF1YLtnYw1 ERDSAHUH/waYWT4Xp1aHzQHpwcKKfFYBub/n5YbLFIG60bu9Td4rdcF6W/LY3nnWWRU/ 8WAA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v134si17292887wmv.143.2017.12.30.03.30.16; Sat, 30 Dec 2017 03:30:17 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7B4BF689C7B; Sat, 30 Dec 2017 13:30:00 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7642B689AE8 for ; Sat, 30 Dec 2017 13:29:54 +0200 (EET) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id vBUBU88S050926 for ; Sat, 30 Dec 2017 12:30:09 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id D119BE0095; Sat, 30 Dec 2017 12:30:08 +0100 (CET) Date: Sat, 30 Dec 2017 12:30:08 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: <20171230113008.GA3546744@phare.normalesup.org> References: <1513312085-31436-1-git-send-email-mymoeyard@gmail.com> <20171217145550.GA3444700@phare.normalesup.org> <20171229120035.GA3050344@phare.normalesup.org> <20171229163026.GA3169805@phare.normalesup.org> <20171229173851.GA3197416@phare.normalesup.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Sat, 30 Dec 2017 12:30:09 +0100 (CET) Subject: Re: [FFmpeg-devel] [PATCH, V2] avformat/concat: Fix wrong wrapped timestamp X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Wu Zhiqiang (2017-12-30): > The command to generate sample video: > > ffmpeg -f lavfi -i testsrc=duration=120 -c:v h264 -profile:v high -level:v > 10 -pix_fmt yuv420p -r 30 -g 30 -c:a aac test.flv > echo -e "file test.flv\nduration 120" > playlist > ffplay -f concat playlist -ss 90 -max_ts_probe 0 > > then seek to time before 30s , the result timestamp is huge and > print:"Invalid timestamps stream" Thanks. I think I understand the problem: it is not that the timestamps are not unwrapped, it is that they are unwrapped twice, because for some reason lavf defaults to parameters tuned for MPEG. See the attached patch. Regards, From 9f24fe25cddabc0b0dc1a60d1789ea7feaa125f7 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Sat, 30 Dec 2017 12:17:08 +0100 Subject: [PATCH] lavf/concatdec: properly init streams timestamp parameters. pts_wrap_bits defaults to 33 (like MPEG), that causes valid timestamps to be unwrapped and become invalid. Inspired by a patch by Wu Zhiqiang . Signed-off-by: Nicolas George --- libavformat/concatdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 0e189012ad..bd5174ada2 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -185,8 +185,8 @@ static int copy_stream_props(AVStream *st, AVStream *source_st) return ret; st->r_frame_rate = source_st->r_frame_rate; st->avg_frame_rate = source_st->avg_frame_rate; - st->time_base = source_st->time_base; st->sample_aspect_ratio = source_st->sample_aspect_ratio; + avpriv_set_pts_info(st, 64, source_st->time_base.num, source_st->time_base.den); av_dict_copy(&st->metadata, source_st->metadata, 0); return 0; -- 2.15.1