From owned video to raw subtitles
From owned video to raw subtitles — Automatic subtitles from local ASR. Freeze the edit version; Extract audio without changing time; ASR creates a draft, not finished captions. Practical assignment: From owned video to raw subtitles.
Demo edition. The materials are undergoing editorial review.
Topics covered
- Freeze the edit version
- Extract audio without changing time
- ASR creates a draft, not finished captions
Freeze the edit version
Subtitles belong to a specific timeline. Removing two seconds from the beginning after ASR shifts later boundaries. For this exercise save your own short, single-voice video as originals/lesson-v1.mp4 in subtitle-lab. Freeze editing before final synchronization. Record duration, language and sourceHash in project.md without inventing a hash you have not calculated. Keep work, reviewed and exports separate from originals. ASR needs an audio stream, not just onscreen writing. Existing burned subtitles are not speech recognition and can create duplicate text during export. Inspect the picture and available streams first. Local processing does not authorize use of someone else’s video; choose owned or licensed material. Tie a new edit version to a new subtitle revision rather than describing old synchronization as current.
Extract audio without changing time
Inside subtitle-lab extract the first audio stream to work/lesson.wav using 16 kHz, mono and PCM16. Do not add -ss or speed filters: raw subtitles should use the same time basis as the video. Resampling should not change speech duration. Check WAV with ffprobe and listen to the beginning and end. For unusual starting timestamps or complex edits, verify synchronization against a visible event such as your own clap. Do not invent an offset solely from container-duration differences. -n prevents overwriting the working WAV; deliberately choose another path for a rerun. If there is no audio stream, revisit source selection. With multiple tracks select the intended one explicitly rather than assuming index zero contains the main language. Save the extraction command in project.md to preserve the timing basis.
ffmpeg -n -i originals/lesson-v1.mp4 -map 0:a:0 -vn -ar 16000 -ac 1 -c:a pcm_s16le work/lesson.wav
ASR creates a draft, not finished captions
Use whisper.cpp prepared through the previous course or official instructions; the executable and multilingual model are separate prerequisites. Here they reside in neighboring asr-lab, while the command runs from subtitle-lab. For Ukrainian audio select uk and both output formats. Expect work/lesson-raw.srt and .vtt. Choose the appropriate language code for another recording. Do not enable translation when captions should retain the spoken language. The result still needs audio-based correction, readable segmentation and player testing. Renaming SRT to .vtt does not convert syntax. If the program was not run, describe these as expected outputs rather than completed files. The command assumes a specific sibling-directory layout; inspect and adjust paths for your own structure. Review silent or hallucinated segments before further formatting.
../asr-lab/whisper.cpp/build/bin/whisper-cli -m ../asr-lab/whisper.cpp/models/ggml-base.bin -f work/lesson.wav -l uk -osrt -ovtt -of work/lesson-raw
Practical assignment
From owned video to raw subtitles
Continue to learning