From patchwork Wed Jun 20 07:09:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Kohm X-Patchwork-Id: 9447 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp409467jad; Wed, 20 Jun 2018 00:09:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLDbPafd62jejCqoOPnLapBD0RqgETx2GYoo765+bVXEDCywSnzEX6efXOwJs4afMFGo1Bm X-Received: by 2002:adf:c358:: with SMTP id e24-v6mr16203862wrg.257.1529478572612; Wed, 20 Jun 2018 00:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529478572; cv=none; d=google.com; s=arc-20160816; b=BAsoMAGTZjQzNiaw0+JQ1HyIaI1cuHpr9CXw98qurFGkH+lL4lsbKngPYZNXzg8T47 HyNcAc8TjIQbhWDrYUo6kIF6xb7Ncndv+Oom56KsY21aeOx0W9euo4CBUcdlCQq4ew5b fCbDqCli9TDQe+oDLEEXycXJa2ikZLBa4WsQqrIO3shNhAitvsAjr7V657opz0HrFZst CgMFyGEIosBvFNWrfNlUwa4srO8qIpci0lmxEaE1AtWtq5S2nyNFUWwwma2AsvhEvV1E qnqhyBl1ksYaAQcU6ythHgYM4BJ/oIRt6FG6pJ71LkoZETKxjyb2QoIqnLZXdq7ztw+r jAsw== 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 :mime-version:message-id:date:to:from:delivered-to :arc-authentication-results; bh=eytqcgZZLE4SkaTZ9WdYO4h6ChSzqHyEFNjBn9NkpgU=; b=M9pQanQMYRmRwGLRyQ46EOKEL1vC/UVRi5k5iJxF8AgcdzRRXdLrA7LhWPCTHlnYQW MkPBSfaM1/ylMIvIMqD24/KvTPKlD5vqcZmkTBLs3lZNfcZv3eOmcyuMOfrozO/MlGLw mexScn+HabEIOCunGEhlDjgT0WiQD3kk5P08BHOSZyRHB7nyjBVHHks7qceNXCEWJVJo TbeKO9O8Hir5RyTDg61MJYMjcPgfVKK8mjJoNY3ORwA18G50PXLOfRXv2aFBKqMvj1b5 Eg/Rfqpe979s3o2ZCvSZw1xD9Rnty0qfZ/kfqj7nk+du+ea4PCDWA1SkI+zt0apn7UTo Rjkw== 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 h12-v6si316686wrb.80.2018.06.20.00.09.31; Wed, 20 Jun 2018 00:09:32 -0700 (PDT) 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 2629E68A28C; Wed, 20 Jun 2018 10:08:36 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24A4A68A145 for ; Wed, 20 Jun 2018 10:08:30 +0300 (EEST) Received: from x61s.fritz.box ([87.122.202.29]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lv9lm-1gDqM43cQM-010ItP for ; Wed, 20 Jun 2018 09:09:22 +0200 From: Markus Kohm To: ffmpeg-devel@ffmpeg.org Date: Wed, 20 Jun 2018 09:09:11 +0200 Message-ID: <22848661.ktHMkvvdCD@komascript.de> X-Face: &j9&UV)xci&*\>K%lnE]u/`\0'`-rm=~HHx|j|3.iu}_m>N*Bu~=@/_5<=!?65%4BgW]f( MIME-Version: 1.0 X-Provags-ID: V03:K1:bc6eN8xhB5VS+1GH0owR24OT46Xs7EuTGF1qprupcp9u90c47Fr pqzT/GohhszUKBuLAsAiNeNVCg6nV5O6WDJ2nDBPpfpvvAyN62RuJh+6lwvktJwn2gmw3hm WP//kMU487kU9beoGmkQYQzgUSFTppItvi1e5XWlpVvmcuhDnwWTIoDMydTiW1fNxmrwJEE bfMG+4IG26OTfbjNAIsLQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:M7SmyUu8ETc=:MxhhGnRuw+Akk3qtirk7ba VUiwXJqqy8DhiUZ99tGbVtkr3yp/DV7r9F5mLb0mwyAR7Ojq67ypyV+dKil9qtQgtRGaFPENf ONszfo1SBLuhDYRqStkgL3rOSDqT7z3tZ59lUpiSs/X/geZeEyfToFZyma6ivIBbKFdeAVW7M XXtXVTV45IB/R1d77i8I+Tiy1arE77eckcVrAWIuS7yLzYNmKWLYpEOoBKdNaAwVjXfv6fVaJ 8MrSvQs+L7Z/U6Y57+dpc6G3WZpQbA3b0x6JYkWhKuTWVOZSFmSYIX1TkB693A7M3jSLVYWea jrPY9dGRjrWFPaDILZk04l1s5v+nPrGXytr+LKWFZFB7/zz7u85CULuLw1rY5qIa0vt1kjiHF WRLj7r427TRAnsrteOenukjlerFahTKFSyP0DQuadSgnzr82fL3U73Z6bt6IHRHZAy58UNwLI aVwb//ufXH4Fbabt8Ijm3XpAbfPcJpEYGkTri3aMjHHQhcVuDgpRdBpyshmojuGvYggMMHFau 7oPjWu9yxL3hYZY2pXlI1OHx1ON8f82nI0RDmNNTEUnTPT+GYJK4xwTDT0VzUf+Bv6i04h/eh CN60FRwXgqVMbU17Lk5sTAxINCjnx83+WVvXSvQeLrmMPDpYrylsCokBOeLTx4wtgrvoSJl2U hf/ziq71yrEu/v7DSn6Ayj/BJoNGc+n3bwd1ajtR680BObe6gVuTMIjST0HDEinwnBMGkejpi aAjr5328gcu3UrQOgyD8PZYj7sHlcbEyk7jSfWsW9rO2oya/l29Oj8MkUXM= Subject: [FFmpeg-devel] ffmpeg patch for nonmonolithic increase dts error in subtitle 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" Recoding videos with subtitles, I often have problems with subtitle streams, because the dts starts again with 0 after some time (I think, it is at jumping from DVD layer 1 to 2, but I'm not sure). There is code in ffmpeg.c to handle such nonmonolithic dts errors in video and audio streams, but for subtitle streams it is not used. Some years ago the dts time fix has been used also for subtitle streams, but this has been removed while changing the code in ffmpeg.c. There is a bug report with an (old) patch for this in the ffmpeg, but this has never found its way to the release. I've adapted the patch for current ffmpeg and it works like a charm. Please add it to your repository. pkt->dts != AV_NOPTS_VALUE && !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) && ost->last_mux_dts != AV_NOPTS_VALUE) { Regards Markus --- fftools.orig/ffmpeg.c 2018-06-20 09:00:12.749632351 +0200 +++ fftools/ffmpeg.c 2018-06-20 09:00:29.262284733 +0200 @@ -772,7 +772,7 @@ - FFMIN3(pkt->pts, pkt->dts, ost->last_mux_dts + 1) - FFMAX3(pkt->pts, pkt->dts, ost->last_mux_dts + 1); } - if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && + if ((st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) && pkt->dts != AV_NOPTS_VALUE && !(st->codecpar->codec_id == AV_CODEC_ID_VP9 && ost->stream_copy) && ost->last_mux_dts != AV_NOPTS_VALUE) {