From d477bf40249b0e354105c741fa7a06505c524db3 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Wed, 2 Dec 2026 13:13:27 +0800 Subject: [PATCH] Verify upload duration and subtitle timelines in source releases Exercise the normalization, joined subtitle timeline, and millisecond boundaries in packaged exports. Describe the upload and playback behavior in the candidate release notes. Signed-off-by: zhifu gao --- .github/actions/clip-export/action.yml | 7 +++++-- docs/releases/v2.2.2.md | 23 ++++++++++++++++++++--- scripts/verify_release_cli.py | 13 ++++++++++--- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/actions/clip-export/action.yml b/.github/actions/clip-export/action.yml index 77ede86..797de1b 100644 --- a/.github/actions/clip-export/action.yml +++ b/.github/actions/clip-export/action.yml @@ -1,4 +1,4 @@ -name: Check source and packaged video export +name: Check source and packaged audio and video export description: Build both FunClip release archives and exercise the CLI inside each one. outputs: sha256: @@ -20,7 +20,10 @@ runs: shell: bash env: HF_HUB_OFFLINE: "1" - run: python -m pytest -q tests/test_cli_audio_clip.py tests/test_cli_video_clip.py tests/test_video_recognition_audio.py tests/test_subtitle_boundaries.py + run: >- + python -m pytest -q + tests/test_cli_audio_clip.py tests/test_cli_video_clip.py tests/test_video_recognition_audio.py + tests/test_audio_normalization.py tests/test_audio_clip_subtitle_timeline.py tests/test_subtitle_boundaries.py - name: Test the CLI from both built archives id: archives shell: bash diff --git a/docs/releases/v2.2.2.md b/docs/releases/v2.2.2.md index 676dce3..f45f1f7 100644 --- a/docs/releases/v2.2.2.md +++ b/docs/releases/v2.2.2.md @@ -2,7 +2,8 @@ This patch is for users who could not open the Gradio upload page, or who selected words in a saved transcript but did not get the expected video file. -It does not change the speech recognition model. +It also fixes playback duration and subtitle timing for audio clips. It does +not change the speech recognition model. - **Open the upload page.** Gradio 4 can return HTTP 500 before the upload controls appear when it encounters a file schema from Pydantic 2.11 or @@ -17,11 +18,21 @@ It does not change the speech recognition model. - **Render Chinese subtitles.** The built-in Pillow renderer now uses Noto Sans CJK SC Medium with its SIL Open Font License in `font/OFL.txt`. It needs neither an extra font download nor ImageMagick. +- **Keep the duration of an uploaded recording.** For Gradio stereo audio, + FunClip uses the first channel and resamples it to 16 kHz. A half-second + selection from a 48 kHz upload now plays for half a second, not a sixth. + This path does not mix the channels or identify speakers. +- **Keep subtitles on the edited timeline.** When you join two audio + selections, the second selection's cues follow the first one's audio. + For stage-2 audio CLI export, choose fresh WAV and SRT names: a missing + match produces neither file instead of exporting the full recording. ## Install or upgrade -Use the versioned source archive and checksum file from the **same** -GitHub release. The two archive formats contain the same source files: +These audio fixes are in [source at 6c36727](https://github.com/modelscope/FunClip/tree/6c367272aa39b1e2df8f9385f1284405e4f2db20). +For an archive install, check that the GitHub release is tagged `v2.2.2` +and use its matching checksum file, not the assets of an older release. +The two archive formats contain the same source files: `FunClip-2.2.2.tar.gz` or `FunClip-2.2.2.zip`. On Linux, starting in a fresh directory containing only `SHA256SUMS` and the downloaded tarball: @@ -48,6 +59,12 @@ download weights; saved-state clip export does not measure ASR accuracy. ## 中文 +Gradio 上传双声道录音时,FunClip 先取第一声道,再重采样到 16 kHz。 +从 48 kHz 录音选出的半秒音频现在会按半秒播放;这不是双声道混音,也不区分说话人。 +拼接多段音频后,字幕按剪辑后的播放顺序计时。命令行第二阶段导出音频时, +请使用新的 WAV 和 SRT 文件名;文字未命中不会导出整段原音。 +这些修复已在上述源码提交中。使用压缩包安装时,请认准 `v2.2.2` 标签,不要拿旧版本代替。 + 如果上传控件还没显示就报 HTTP 500,且报错位于 Gradio 的文件类型解析, 请在 FunClip 的 Python 环境中安装本版依赖,不用重新下载识别模型。 使用已有转写结果裁剪视频时,`--output_file` 指定的 MP4 和同名 SRT diff --git a/scripts/verify_release_cli.py b/scripts/verify_release_cli.py index 84ece0f..6646e71 100644 --- a/scripts/verify_release_cli.py +++ b/scripts/verify_release_cli.py @@ -14,6 +14,11 @@ TEST = Path("tests/test_cli_video_clip.py") AUDIO = Path("tests/test_cli_audio_clip.py") SUBTITLES = Path("tests/test_subtitle_renderer.py") +AUDIO_REGRESSIONS = ( + Path("tests/test_audio_normalization.py"), + Path("tests/test_audio_clip_subtitle_timeline.py"), + Path("tests/test_subtitle_boundaries.py"), +) CASE = TEST.as_posix() + "::CLIClipTests::test_stage_two_exports_the_selected_video_and_subtitle" @@ -38,12 +43,14 @@ def verify(dist): with tarfile.open(artifact, "r:gz") as archive: archive.extractall(tmp, filter="data") root = Path(tmp) / prefix - for test in (TEST, AUDIO, SUBTITLES): - if (root / test).read_bytes() != (ROOT / test).read_bytes(): + for test in (TEST, AUDIO, SUBTITLES, *AUDIO_REGRESSIONS): + packaged = root / test + if not packaged.is_file() or packaged.read_bytes() != (ROOT / test).read_bytes(): raise ValueError(f"{test} differs from checkout in {artifact.name}") print(f"Testing stage-2 export and subtitle rendering from {artifact.name}", flush=True) subprocess.run([sys.executable, "-I", "-m", "pytest", "-q", "-o", "pythonpath=.", - CASE, AUDIO.as_posix() + "::test_selected_audio_and_subtitle", SUBTITLES.as_posix()], + CASE, AUDIO.as_posix() + "::test_selected_audio_and_subtitle", SUBTITLES.as_posix(), + *(test.as_posix() for test in AUDIO_REGRESSIONS)], cwd=root, env=env, check=True, timeout=180)