From patchwork Tue Dec 21 15:02:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 32803 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp5507139iog; Tue, 21 Dec 2021 07:03:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWKpa7ERL1aGEmF8sLLaOmZHkxFrJFFgYjDmG+o8UxG6vt0ChHdYPOXxwq55s/oE+TwH+1 X-Received: by 2002:a17:907:961c:: with SMTP id gb28mr2951269ejc.385.1640099011756; Tue, 21 Dec 2021 07:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640099011; cv=none; d=google.com; s=arc-20160816; b=ZXTcWmxavF3EIpi/yGZQrJNC5uWEAX2MsUfnw9YdqvNELSsANxwnRm4pjitnxWcJbO QcWF3ns4dZXXvCkNMD6YPXPJpIW88OIrmYf8p98T3PxPIIXC8H6jJJf7CWYrC+3VFvuj qEDQQH95aqO76A7kVQzlasifyWHjg8xSSMvK2J1wCFotASAuh5fkJSnbtZPmEfNWb3QR dthK5Ctdz9iUA4mGmizD73npG5tvq4iS6YM0EAww7br9FLj627tC38eT9HuoxzU/vFIv JNzcVeNj5l6M5HnqRW9Ry+334DzmbQXXUmlkN8OnKJkO+DKJsg+sTK9IiPmmi8MfPh0k 0YiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=kR6JHvVrcjYfIIQ6XTQbCRdDR2JCDEiw2qtf66jdHBc=; b=KRidB9cr3cKgHjNAMDVFsiie5AcKMThqhs6y/0X8yhNmUKgKU3EDfPEwk0kpLB6uoD 8PiFlXoy8BWE6UYzLvnfXMYhvjchzn7/uSx4YinwRID7Q/J/8BDnJROVH7LurvmLBwPl MhUIE8Rhv/4d/ogL1I1FFh8uUh3KkcgFLc73Ww2zP24mbzD4NlrmfcZxrxC18WIF8+dr a8X2dqIGtEwsQddDYvT9eJFKzr9POYIV+aqTMZx0k6S+wnedGpu43HUboIqjnl8R9oO2 iXsE7uI10Nr/K2IB3dtIC6p5057bTgtqGxdrgDqNuo1WogAYY4BGHL7VGyx1axd6vJfJ YfrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Z31YtPum; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id la13si11240808ejc.450.2021.12.21.07.03.08; Tue, 21 Dec 2021 07:03:31 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Z31YtPum; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5E45C68A61A; Tue, 21 Dec 2021 17:03:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 946CF68AE4E for ; Tue, 21 Dec 2021 17:02:57 +0200 (EET) Received: by mail-lf1-f54.google.com with SMTP id g11so30054177lfu.2 for ; Tue, 21 Dec 2021 07:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=AUXtPkAsYRZrM4KL98HnxNKUU2f/XTtDu/jZq+UYKjc=; b=Z31YtPumzrmOcpuh3IpimTvoM0Bbt8J8IvAvwAyHW2XZh/v/7aVI3Bg/cND7BE2a6p zPz/pe9MKJAL2jjSuqpmehg5hDjT6dpK4SoMo2kWY7ckF17q91SML9KWMdfmtAlMl+6a JlyAkJdagL3Km8Zmj3p8OFSEIZg/TiUDXkvqo3fDLGqUvnIYf6vHQLIVeXsb8dxxzC5g 6+FficdypgsejGMdhXuQM8G5soj8rPjXiLFVk1hT/J3cBYb8aQ0Rsrs7+wGncNNhwW4R mcey8KPExkeUZ3NB/xZ8LXk4VEgwrnvaevyVSs/OlcoqnSougF4JVno58UCasr43clUF jfdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AUXtPkAsYRZrM4KL98HnxNKUU2f/XTtDu/jZq+UYKjc=; b=bH0s1xoJmS2HimmmjAHLUiaKliFQbcKmFxHxlAJIL9loQiQYPub4SxDOeXetkUfxsr hCIVCwADHZdqKRnKsU9Vu4LuJJddGLFy652QaxwdJduXr+9P0S+mVQwvkANpv3bU8mcw IIh4+LqQ9gfXkHMaum6RpCfrBofZa8s0KZMzxjDKjvQLPZY2cVBMgAV6r/sFEb7oPx9w nk2zVN4fZQOM0Xgpyv1kR0iFmlWJutuceIg2fdq0rfUkvsItHNfa8fUs/bPqAERdEYI/ uDUZdAPT9BpzcCbk1v2wcBJ3dLJkbVl86Pain5DqYegu/3YRxiAxryKl7l9UAFLRZ/cN Dh6Q== X-Gm-Message-State: AOAM531RJbUhlhaACFKIE64KBmPBhylEGOZ9ACYhm8oDTfgKeJMWwl8A uXTKcMf4ilZIKNrz7MfHYCzu0VGbSIE= X-Received: by 2002:ac2:5504:: with SMTP id j4mr3444888lfk.332.1640098976783; Tue, 21 Dec 2021 07:02:56 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id g16sm2042320lfu.292.2021.12.21.07.02.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 07:02:56 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Dec 2021 17:02:46 +0200 Message-Id: <20211221150246.17786-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211221074601.12074-1-jeebjp@gmail.com> References: <20211221074601.12074-1-jeebjp@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3] tests: add test for ffmpeg's fix_sub_duration feature 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: puSJeL4cZi1r From: Jan Ekström This long-existing feature calculates subtitle durations by keeping it around until the following subtitle is decoded, and then utilizes the following subtitle's pts as the end point of the previous one. Signed-off-by: Jan Ekström --- tests/fate/ffmpeg.mak | 10 +++++++++ tests/ref/fate/ffmpeg-fix_sub_duration | 31 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tests/ref/fate/ffmpeg-fix_sub_duration diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 4ba73a8dfa..f0d737aa5d 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -94,6 +94,16 @@ FATE_FFMPEG-$(call ALLYES, FILE_PROTOCOL LAVFI_INDEV RAWVIDEO_DEMUXER \ fate-shortest: tests/data/vsynth_lena.yuv fate-shortest: CMD = framecrc -auto_conversion_filters -f lavfi -i "sine=3000:d=10" -f lavfi -i "sine=1000:d=1" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -f rawvideo -s 352x288 -pix_fmt yuv420p -i $(TARGET_PATH)/tests/data/vsynth_lena.yuv -filter_complex "[0:a:0][1:a:0]amix=inputs=2[audio]" -map 2:v:0 -map "[audio]" -sws_flags +accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -idct simple -dct fastint -qscale 10 -threads 1 -c:v mpeg4 -c:a ac3_fixed -shortest +# Basic test for fix_sub_duration, which calculates duration based on the +# following subtitle's pts. +FATE_FFMPEG-$(call ALLYES, LAVFI_INDEV MOVIE_FILTER FILE_PROTOCOL \ + PIPE_PROTOCOL MPEGVIDEO_DEMUXER MPEG2VIDEO_DECODER \ + CCAPTION_DECODER SUBRIP_ENCODER SRT_MUXER) \ + += fate-ffmpeg-fix_sub_duration +fate-ffmpeg-fix_sub_duration: CMD = fmtstdout srt -fix_sub_duration \ + -real_time 1 -f lavfi \ + -i "movie=$(TARGET_SAMPLES)/sub/Closedcaption_rollup.m2v[out0+subcc]" + FATE_STREAMCOPY-$(call ALLYES, EAC3_DEMUXER MOV_MUXER) += fate-copy-trac3074 fate-copy-trac3074: $(SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3 fate-copy-trac3074: CMD = transcode eac3 $(TARGET_SAMPLES)/eac3/csi_miami_stereo_128_spx.eac3\ diff --git a/tests/ref/fate/ffmpeg-fix_sub_duration b/tests/ref/fate/ffmpeg-fix_sub_duration new file mode 100644 index 0000000000..0ede5c6b90 --- /dev/null +++ b/tests/ref/fate/ffmpeg-fix_sub_duration @@ -0,0 +1,31 @@ +1 +00:00:00,968 --> 00:00:01,168 +{\an7}( + +2 +00:00:01,168 --> 00:00:01,368 +{\an7}( inaudibl + +3 +00:00:01,368 --> 00:00:01,568 +{\an7}( inaudible radio chat + +4 +00:00:01,568 --> 00:00:03,103 +{\an7}( inaudible radio chatter ) + +5 +00:00:03,103 --> 00:00:03,303 +{\an7}( inaudible radio chatter ) +>> + +6 +00:00:03,303 --> 00:00:03,503 +{\an7}( inaudible radio chatter ) +>> Safety rema + +7 +00:00:03,504 --> 00:00:03,704 +{\an7}( inaudible radio chatter ) +>> Safety remains our numb +