Translating a video isn't a CSV operation. Suppose you already have a Chinese product tutorial and are preparing the same picture edit with an English dub and English subtitles. The subtitles can be valid text and still belong to the wrong audio take. A shared release name helps catch that; a timing check catches a different class of preventable mistakes.
CutNow, an AI video editor for existing footage, connects translated voice, corresponding timed subtitles, and the video delivery in its localization workflow. Editorial review still has to check the meaning, pronunciation, and the action on screen. The code below is a separate, original Python utility for the narrower file-hygiene problem. It is not CutNow code, does not call its product, and doesn't inspect the contents of video or audio files.
What the checker validates
The complete standard-library checker, ten tests, original SRT fixture, version notes, usage instructions and MIT license are publicly available in the companion Gist. Requires Python 3.10 or newer; the local checks ran with Python 3.12. It uses only Python's standard library and checks:
- Strict UTF-8 decoding of a user-provided basic
.srt(a leading UTF-8 BOM is accepted). - Sequential numeric cue indices, valid
HH:MM:SS,mmm --> HH:MM:SS,mmmranges, increasing start/end times, nonempty captions, and no overlapping cue ranges. The no-overlap rule is a handoff policy, not a claim that every subtitle format universally forbids overlaps. - An optional maximum duration supplied by the editor, such as
00:00:20,000. - Optional MP4, M4A/WAV, and
.txtversion-note existence, compatible extensions, shared basenames, and matchingrelease_stem,language, andversionfields.
The project_en_v03 pattern is our illustrative naming convention, not a requirement imposed by platforms or CutNow.
Here's the key idea from the script:
# Extracted from the original accompanying standard-library utility.
# validate_srt() and validate_delivery() are defined in the linked .py file.
from pathlib import Path
from localization_package_check import validate_srt, validate_delivery
srt = Path("stand-demo_en_v03.srt")
report = validate_srt(srt, max_duration_ms=20_000)
validate_delivery(srt, None, None, Path("stand-demo_en_v03.txt"))
print(report.count, report.last_end_ms)
The package includes a fully usable CLI so you don't have to import it:
python localization_package_check.py --srt stand-demo_en_v03.srt \
--max-duration 00:00:20,000 --notes stand-demo_en_v03.txt
python -m unittest -v test_localization_package_check
Expected CLI summary for the included original text fixture:
PASS: UTF-8 SRT; 3 cues; strictly increasing, non-overlapping times; last end 00:00:17,200.
PASS: duration bound 00:00:20,000.
PASS: delivery stem stand-demo_en_v03 (notes; names and notes only).
NOTE: Not a media, pronunciation, semantic, synchronization, or CutNow product test.
The ten self-tests intentionally cover UTF-8 rejection, overlaps, inverted times, non-increasing times, duration overrun, cue indices, matching package names, and mismatched versions. The test suite creates empty placeholder media filenames solely to exercise filename validation; it does not assert that those placeholders contain real video.
Why those files should belong together
Imagine a fictional adjustable-stand tutorial: first loosen a knob, then raise the arm, then tighten the knob. An English sentence can have perfect grammar yet arrive after the viewer has moved on to the next action. That calls for a human looking at the video, not a parser.
In practice, I would request stand-demo_en_v03.mp4, stand-demo_en_v03.srt, and an optional stand-demo_en_v03.m4a, together with stand-demo_en_v03.txt identifying the approved picture master. The checker can catch accidental v04 audio names in a v03 folder. It cannot compare audio waveforms, prove that words match the picture, verify subtitle track embedding, or infer missing captions from gaps.
Where automation ends
Run the script before handoff, then have a target-language reviewer play the complete tutorial and check the opening, each action boundary, and ending. Listen without text, read without audio, and finally inspect the exported version in the destination player. Fix the affected voice and subtitle assets together if a translation changes.
CutNow's public dubbing/delivery guide documents one checked Chinese-to-English tutorial MP4/SRT/audio package; its contextual subtitle guide focuses on conditions, names, and timing. That public product evidence is separate from the tests of this independent script. The imaginary stand example was not run through CutNow.
Disclosure: CutNow team; AI-assisted article. The utility and tests are independently prepared examples and were run locally, not inside CutNow.
Top comments (0)