From patchwork Mon Dec 20 17:22:36 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: 32765 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp4581429iog; Mon, 20 Dec 2021 09:22:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEsjMqUrr5Xoz/WwpLKTXFiRoxb+dMbe/1dwhMCql824uISL9QmG0mP/ahxgr+wdupPLVY X-Received: by 2002:a17:906:58c8:: with SMTP id e8mr13396220ejs.380.1640020974582; Mon, 20 Dec 2021 09:22:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1640020974; cv=none; d=google.com; s=arc-20160816; b=SukbbYQGHbVMmw/b0Tfc/yTwtY2hjQwq+HQhKTZyF0hZHEoZF0p4YTvLdoch98L1GV RCGyl7nzmdKGgANjWtvYKyO+QmPH52pK7GPQwLHn+zFBdhjLJ2+Z7YnAvyNOyRvKROP5 JB6UA/gYiUOOw+fg/nLTt+++z2Udo5HnkdQ6dPLKfVkNXRnf0TMzOpidf6Xr7vwECO7r 5bCzStpfHsOp6+LIC4FzQmvgfkJLhvkQZcHiha52mD2I5Jfqd6QkqOZnhN52T6PF610s GS4qHaKEUxFzUx+BS5RJ47cgpLt58BBu+k0ja8IFn8rw69yKfGq6l6mWnh0mUUPP2aCE xi4A== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=GfB1Gsy0WfE4hI6QkLF3Q3hnotBWs5y82up2aoEnQk8=; b=DVjXMftYFspPosnHMVHg3n6c80m4GUYjbY/J+i9Xx2JKhn5Xum6JHU3CdUtVqdL2j+ XUYbj7PvvvZsDyMO1pVKU8+/Qh0KRv4Co/4fIIIzEKmH2NUUXnfR7fGyGn2GyD72dW6s uNzPSjRv7tnuXZO5XcWg0haGhualNrYYIqaNIfOgEzvb+LW+UdC018MqV+04Vh44Y14/ 44z0rDtE9CcNeAgUj5VnxkX+jrPq3EyXQQm2fSO+45FNolGzUmIgCZ8bIqhZkrAXHJbm xzQvhuW9M6PZoKRiYtKZDv8HctLnhBc4aPfNTBKpHHHVMme+ndxoTo3dPCMLPiVJ0atA XHiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=P6fsyAdp; 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 r19si12734683edd.98.2021.12.20.09.22.53; Mon, 20 Dec 2021 09:22:54 -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=P6fsyAdp; 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 3925368AFBD; Mon, 20 Dec 2021 19:22:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 29B8C68AFAA for ; Mon, 20 Dec 2021 19:22:43 +0200 (EET) Received: by mail-lf1-f46.google.com with SMTP id x21so15076458lfa.5 for ; Mon, 20 Dec 2021 09:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=U6DYyJukdBH6o9ZKCbcqegt/iU/kkOWz9CNj36ti+54=; b=P6fsyAdppfagCv8jZjyX79dW14JENIhF69+wHGd+nArynemU85fK1YMGigEFfQ9dtv 42/aMHcIkCaRx1aNJ5dPS0PY5taFqYPZJaw6s0sWf4eL9beZ3AGG5+n/Y9nGGhKccgay rCrwGwEsFZi5E4kbvVGMRrbXV5R6BBFwDbxZ7VxpXvcThRFYpsitLF2bz9Wi2912PurG waONwkIuQRUUpvqimqSUd1y2mDI9Rx8SbIm7e5nxTmAP/0lbv078bnbmk4sTpS9k4Qz7 6lfGq9h9MpQHlVomWrkhiEFzWvFFHv0xIkt+ywl/WqMfOhN3+GKCh5/UhObBfyl8mHE4 llhg== 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:mime-version :content-transfer-encoding; bh=U6DYyJukdBH6o9ZKCbcqegt/iU/kkOWz9CNj36ti+54=; b=Qjf/xgIb7FmJVaaLXiSslBYTpGn9z1Gu3/9PFO43WxKjvXZatO+HTbab5yK2zmox21 oqKIAj1+i6LS64ctNHSq092R+r2rt59rccm62yOZ6/H/gjKDGyZxp6t2Ttkv4z7080W2 sCjNKbuDZbBh4xKHTJk4joGPmsBK9ewXMdwPOpJI9JYqdYuCZ5Ek8J08OY/ZNheO24wW pNMUM2doUWICTIwTckgMxHZqUKhci4dqjGPhohgrzm1sbdgqBc6x0qr8eaU4CwRzbeHo aiXYyUW3xduenvq4dci7TaDMB6d1mdBKfCukdKqi2lHwE+IsNzV7fR5r+pzBJ0l8ddkB hgRw== X-Gm-Message-State: AOAM531WXa5wZdURgdKxBCJqVzFd1IIbd6AVTWs4On2qU+J6OBSA0yh9 yj+L74+PdPBYoGI4t1ru+Ats1o2t4dY= X-Received: by 2002:a05:6512:3242:: with SMTP id c2mr4977597lfr.182.1640020962410; Mon, 20 Dec 2021 09:22:42 -0800 (PST) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id br37sm939649lfb.99.2021.12.20.09.22.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Dec 2021 09:22:41 -0800 (PST) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Dec 2021 19:22:36 +0200 Message-Id: <20211220172236.9515-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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: /WNO5fIxQdfR From: Jan Ekström Signed-off-by: Jan Ekström --- tests/fate/ffmpeg.mak | 8 ++++++ tests/ref/fate/ffmpeg-fix_sub_duration | 40 ++++++++++++++++++++++++++ 2 files changed, 48 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..63721f2209 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -94,6 +94,14 @@ 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, FILE_PROTOCOL PIPE_PROTOCOL SAMI_DEMUXER \ + SAMI_DECODER TEXT_ENCODER SRT_MUXER) \ + += fate-ffmpeg-fix_sub_duration +fate-ffmpeg-fix_sub_duration: CMD = fmtstdout srt -fix_sub_duration \ + -i "$(TARGET_SAMPLES)/sub/SAMI_capability_tester.smi" + 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..238c9ab635 --- /dev/null +++ b/tests/ref/fate/ffmpeg-fix_sub_duration @@ -0,0 +1,40 @@ +1 +00:00:00,000 --> 00:00:00,010 +Pres. John F. Kennedy + + +2 +00:00:00,010 --> 00:00:08,800 +Pres. John F. Kennedy +Let the word go forth, from this time and place to friend and foe alike that the torch + +3 +00:00:08,800 --> 00:00:19,500 +Pres. John F. Kennedy +has been passed to a new generation of Americans, born in this century, tempered by war, + +4 +00:00:19,500 --> 00:00:28,000 +Pres. John F. Kennedy +disciplined by a hard and bitter peace, proud of our ancient heritage, and unwilling to witness + +5 +00:00:28,000 --> 00:00:38,000 +Pres. John F. Kennedy +or permit the slow undoing of those human rights to which this nation has always + +6 +00:00:38,000 --> 00:00:46,000 +Pres. John F. Kennedy +been committed and to which we are committed today at home and around the world. + +7 +00:00:46,000 --> 00:01:01,000 +Pres. John F. Kennedy +Let every nation know, whether it wishes us well or ill, that we shall pay any price, bear any burden, + +8 +00:01:01,000 --> 00:01:13,000 +Pres. John F. Kennedy +meet any hardship, support any friend, oppose any foe, to ensure the survival and success of liberty. +