mudler / mudler/parakeet.cpp

How to get sentence-level timestamps?

Open
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
786
Forks
93
PR merge metrics
No merged PRs in 30d

Description

parakeet output is word-level timestamped, but is friendly/traditional to make a subtitle for a video/audio transcription. Is possible to get sentence-level output? There is a local tool that can do it?

I was able to get word-level transcription with:

parakeet-cli transcribe --model tdt-0.6b-v3-q4_k.gguf --input in.wav --json > out.json

And with this shell script I was able to convert to WebVTT subtitle:

#!/bin/sh
jq -r '
  def format_time:
    . as $s |
    ($s / 3600 | floor) as $h |
    (($s % 3600) / 60 | floor) as $m |
    ($s % 60 | floor) as $sec |
    ($s * 1000 | floor % 1000) as $ms |
    "\(if $h < 10 then "0" else "" end)\($h):\(if $m < 10 then "0" else "" end)\($m):\(if $sec < 10 then "0" else "" end)\($sec).\(if $ms < 10 then "00" elif $ms < 100 then "0" else "" end)\($ms)";

  "WEBVTT\n\n" + ([.words[] | "\(.start | format_time) --> \(.end | format_time)\n\(.w)"] | join("\n\n")) + "\n"
' "$1"
  • The output is one word per subtitle line, that is not very friendly to create a subtitle for a video or audio recording.
  • Do you know a way to convert the transcription in a more traditional (sentence-level timestamps) subtitle?
Workaround

Using Word Timestamp to Subtitles online tool, I was able to get an expected formatted subtitle from JSON output (from parakeet), but I'm searching a local/offline tool, because privacy.

This should work but give me errors, and I'm not a programmer to fix that.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the parakeet-cli transcribe command and its JSON output, then inspect how word timestamps are exposed. Compare the requested sentence-level subtitle behavior with the linked make_subtitles.py script and determine whether this belongs in the CLI or as a local companion tool. Done should mean a documented, privacy-preserving way to produce traditional sentence-level subtitles.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
audio-video-rtc, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.