Estimate a folder of clips transcription cost with ffprobe

Sum each clip's seconds with ffprobe, flag anything over 600 s, and price it at $0.01 per audio minute before you submit a single Sume STT job.

4 min readSume
All posts

To price a folder of audio before you transcribe it with Sume STT 1.0, read each file's length with ffprobe, round up to whole seconds, and multiply the total by $0.01 / 60. Any single clip over 600 seconds is above the STT limit (duration_seconds is an integer from 1 to 600) and has to be cut first. The $0.01 per audio minute rate and the per-second proration come from the Sume pricing described in Video inspect, read 2026-10-06.

Rounding rules to copy

Use the same rounding the job uses so the estimate and the invoice agree: a one-second minimum, whole seconds from duration_seconds, and cost computed on the sum, not rounded per clip to a minute.

Estimator inputs for STT 1.0, from the Sume API reference and pricing docs (docs.sume.com), read 2026-10-06.
InputRule
duration_secondsInteger, 1 to 600; omitting it reserves one minute
Rate$0.01 per audio minute, prorated per second
Longest clip600 s (10 minutes); cut longer audio first
Audio sourcePublic HTTPS URL

The script

It needs ffprobe on the PATH. The sample below printed (5, 0.0008, ['b.wav']) for one 4.2-second clip and one 700-second clip: 5 billable seconds, $0.0008, and the long file flagged.

import json, math, pathlib, subprocess, sys

RATE_PER_SECOND = 0.01 / 60
MAX_SECONDS = 600


def duration(path):
    out = subprocess.run(
        ["ffprobe", "-v", "error", "-show_entries", "format=duration",
         "-of", "json", str(path)],
        capture_output=True, text=True, check=True,
    ).stdout
    return math.ceil(float(json.loads(out)["format"]["duration"]))


def estimate(folder):
    total, too_long = 0, []
    for p in sorted(pathlib.Path(folder).glob("*.wav")):
        seconds = max(1, duration(p))
        if seconds > MAX_SECONDS:
            too_long.append(p.name)
            continue
        total += seconds
    return total, round(total * RATE_PER_SECOND, 4), too_long


print(estimate(sys.argv[1]))

Then send the same seconds with each job

Pass each clip's rounded seconds as duration_seconds. The hold then matches the estimate, and your wallet is not tied up at one minute per in-flight job. Check the balance and queue room with an admission preview before the first submit.

Sources

Related posts

More in Pricing

All Pricing posts

Written by Sume