Skip to content

Hold the last CDG frame instead of ending the video at the graphics end (2.3.4) - #69

Merged
liladas merged 1 commit into
mainfrom
fix/short-cdg-truncation
Jul 21, 2026
Merged

liladas merged 1 commit into
mainfrom
fix/short-cdg-truncation

Conversation

@liladas

@liladas liladas commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #64.

Problem

Real karaoke rips often have a .cdg that ends before the .mp3. The conversion's -shortest flag cut the entire output at the graphics end, which users experienced as truncated videos. The pre-rewrite Python command (1f272cc) had no -shortest, so those files produced a full-length song with the graphics frozen on the last frame, at the cost of a video track shorter than the audio track (player-dependent behavior).

Change

Append tpad=stop_mode=clone:stop=-1 to the video filter chain and keep -shortest. The video stream clones its last frame indefinitely and can never end first, so -shortest ends the file exactly at the audio's end, with real encoded frames throughout. A .cdg longer than the audio is still trimmed (no silent tail).

Also mirrored in the "Prefer the command line?" disclosure (command string + explanations), PRODUCT_SPEC.md, and README.md, where the documented command was still the pre-rewrite -s 640x480 form.

Verification

  • Exact new arguments run against the shipped ffmpeg.wasm 0.12.10 core in headless Chromium:
    • 6 s graphics + 40 s mp3 → 40.6 s output, exit 0 (cloned frames added ~0.5 MB)
    • 320 s graphics + 8 s mp3 → 8.4 s output, exit 0
  • Native ffmpeg 8: same behavior in both directions; a 256 s pair also confirmed there is no 4-minute limit anywhere (see Report: converted videos truncated, suspected duration cap under 4 minutes #64)
  • vitest 78/78, eslint clean (3 pre-existing warnings), tsc -b clean, Playwright e2e 5/5

…nd (2.3.4)

Real karaoke rips often have a .cdg that ends before the .mp3. The exec's
-shortest then cut the whole song at the graphics end, reported as videos
being truncated (#64). The pre-rewrite command had no -shortest and played
the full song with the graphics frozen, but relied on player-dependent
handling of a video track shorter than the audio.

Add tpad=stop_mode=clone:stop=-1 to the filter chain: the video clones its
last frame indefinitely, so -shortest always ends the file at the audio's
end, with real encoded frames all the way. This also trims the silent tail
when the .cdg is the longer input. Verified against the 0.12.10 wasm core
in both mismatch directions.

Mirror the filter in the local-command disclosure, the product spec, and
the README (whose command was still the pre-rewrite -s 640x480 form).

Fixes #64
@liladas
liladas merged commit 653bfdd into main Jul 21, 2026
3 checks passed
@liladas
liladas deleted the fix/short-cdg-truncation branch July 21, 2026 17:31
liladas added a commit that referenced this pull request Jul 22, 2026
Doc-only fixes from an audit of planned-vs-implemented behavior:

- feedback-and-analytics.md event taxonomy rewritten to match the code:
  input_type is "zip" | "pair" (not "loose"), conversion_failed sends
  reason (not error_code), and the 11 shipped events missing from the
  list (theme_toggled, command_copied, feedback_opened, ...) are now
  documented, along with the file-name properties and super props.
- Note that file names are sent (contents never are); the old "no file
  names ever sent" claim predated ConvFiles.
- Tally integration section updated from "link-out first, popup later"
  to the shipped popup-with-link-fallback shape.
- Feedback-prompt dismissal documented as in-memory per visit, matching
  feedback.ts, instead of the planned localStorage persistence.
- PRODUCT_SPEC.md: drop the resolved README -s 640x480 limitation
  (fixed in #69) and bump the last-reviewed date.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report: converted videos truncated, suspected duration cap under 4 minutes

1 participant