Evals / video / Subtitles

Burn subtitles into a video

Burn the subtitles from talk.srt into bunny.mp4 so they are always visible. Save it as subbed.mp4.

The task

The reference answer shows the job can be done with deft. It is not an agent run.

deft video add-subtitles bunny.mp4 --subtitles talk.srt -o subbed.mp4

Input

bunny.mp4 946.5 KB · h264 1280x720, 10.0s
talk.srt 180 B
1
00:00:00,500 --> 00:00:03,000
A quiet morning in the forest

2
00:00:03,500 --> 00:00:06,000
The big bunny wakes up

3
00:00:06,500 --> 00:00:09,500
Something is about to happen

Reference output

subbed.mp4 1.9 MB · h264 1280x720, 10.0s
How a result is judged (2 checks)
  • media: file = "subbed.mp4", duration = 10, tolerance = 0.6, has_video = true
  • video_frame: file = "subbed.mp4", from = "bunny.mp4", at = 1.5, min_difference = 0.15

Runs

CodexWithout deftPassed2026-11-07

Time
12s
New tokens
6.5k
Total input
58.5k
Output tokens
0.3k
Commands
2
Failed
0

Trace

  1. I’ll check the media files and available video tools, then render the subtitled video in the current directory.

  2. pwd && rg --files -g 'talk.srt' -g 'bunny.mp4' -g 'subbed.mp4' && command -v ffmpeg
    output
    bunny.mp4
    talk.srt
    /opt/homebrew/bin/ffmpeg
  3. ffmpeg -y -i bunny.mp4 -vf subtitles=talk.srt -c:v libx264 -crf 18 -preset medium -c:a copy subbed.mp4
    output
    ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
      built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
      configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1.1_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
      libavutil      59. 39.100 / 59. 39.100
      libavcodec     61. 19.101 / 61. 19.101
      libavformat    61.  7.100 / 61.  7.100
      libavdevice    61.  3.100 / 61.  3.100
      libavfilter    10.  4.100 / 10.  4.100
      libswscale      8.  3.100 /  8.  3.100
      libswresample   5.  3.100 /  5.  3.100
      libpostproc    58.  3.100 / 58.  3.100
    Input #0, mov,mp4,m4a,3
    … 5057 more characters
  4. The burn-in is rendering successfully. I’m waiting for FFmpeg to finish writing the MP4.

  5. Done. The subtitles are burned into [subbed.mp4](subbed.mp4).

Output

subbed.mp4 4.7 MB · h264 1280x720, 10.0s

CodexWith deft, skill installedPassedRead the skillUsed deft2026-11-07

Time
15s
New tokens
12.0k
Total input
72.8k
Output tokens
0.4k
Commands
4
Failed
0

Trace

  1. I’ll use the `deft` skill for the video subtitle burn-in, then save the result as `subbed.mp4` in the current directory.

  2. cat .agents/skills/deft/SKILL.md
    output
    ---
    name: deft
    description: "Use deft instead of writing a script for file jobs: PDF merge/split/compress/watermark, image resize/convert/compress, video and audio trim/convert/compress, spreadsheets, Markdown to PDF/HTML, and YouTube downloads and subtitles."
    ---
    
    # deft
    
    One local command for file jobs. Prefer it over writing Python or shell scripts.
    
    Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
    
    Groups:
    - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
    - `image`: Resize, crop, convert, compress, filters, montage, OCR
    - `video`: Trim, crop, speed, convert, compress, GIF, frames (ffmpeg)
    - `audio`: Convert, trim, merge, fade, speed, tag, normalize (ffmpeg)
    - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
    - `slides`: PowerPoint: extract text, Markdown outline, PDF handout
    - `data`: JSON/YAML/TOML/XML: convert, query with jq syntax, merge, diff
    - `sheet`: Excel/CSV/ODS tables: filter, sort, join, pivot, convert
    - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
    - `html`: HTML to Markdown, text, Word, PDF; screenshots
    - `epub`: E-books: info, to text, Markdown and PDF
    - `email`: EML files: headers, text, attachments
    - `contact`: VCF address books: to and from CSV
    - `calendar`: ICS calendars: to and from CSV
    - `gps`: GPX and KML tracks: convert, distance and time
    - `youtube`: Info, download, audio, subtitles, thumbnail (yt-dlp)
    - `file`: Any file: hash, duplicates, batch rename, base64, encoding
    - `qr`: Cre
    … 728 more characters
  3. deft video
    output
    deft video - commands (input -> output)
      info               video -> report      Duration, size, frame rate, codecs
      add-audio          video -> video       Replace or mix the soundtrack: --audio song.mp3
      add-subtitles      video -> video       Add subtitles: burned into the picture, or --soft
      chunk              video -> video...    Cut into equal parts: --length 10:00
      compress           video -> mp4         Smaller file: --level, --target-size, --max-height
      convert            video|gif -> video   Change container and codec: --to mp4|webm|mov|mkv
      crop               video -> video       Cut a region: --box or --aspect 1:1
      download           url -> video         Save a video: --resolution 720p, --to mp4|webm|mkv [net]
      extract-audio      video -> audio       Save the soundtrack: --to mp3|m4a|wav|flac|ogg
      extract-subtitles  video -> srt|vtt     Save an embedded subtitle track: --to srt|vtt
      fade               video -> video       Fade: --fade-in 1 --fade-out 2
      frames             video -> png|jpg...  Save frames as images: --fps 1 or --at 0:05,0:10
      from-images        image... -> video    Slideshow: --duration, --fps, --audio
      merge              video... -> mp4      Join videos; --transition fades
      mute               video -> video       Remove the audio track
      pad                video -> video       Fit into a frame with bars: --size 1080x1920
      repeat             video -> video       Repeat a video: --count 3 plays it three times
      resize             vid
    … 891 more characters
  4. deft video add-subtitles --help
    output
    deft video add-subtitles - Add subtitles: burned into the picture, or --soft
    
    Usage: deft video add-subtitles <video>... [-o <video|dir>] [options]
    In: video (each handled separately)   Out: video (default <name>.subtitled.<ext>)
    Burned subtitles use this machine's fonts, so Chinese and other scripts work.
    --soft adds a track the viewer can turn off (no re-encoding).
    
    Options:
      --subtitles <path>           An .srt or .vtt file (required)
      --soft                       Add a selectable track instead of burning in
      --font-size <number>         Text size in pixels (default: 5% of the height)
      --color <color>              Text color (default white)
      --position <position>        bottom or top (default bottom)
      --font <text>                Font family
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft video add-subtitles clip.mp4 --subtitles talk.srt -o subbed.mp4
      deft video add-subtitles clip.mp4 --subtitles zh.srt -o zh.mp4
      deft video add-subtitles clip.mp4 --subtitles talk.vtt --soft -o soft.mp4
    
    Result fields: cues
    Needs: ffmpeg, ffprobe
  5. deft video add-subtitles bunny.mp4 --subtitles talk.srt -o subbed.mp4
    output
    ok video.add-subtitles bunny.mp4 -> subbed.mp4  3 lines burned in  0.83s
  6. Burned the 3 subtitle lines into [subbed.mp4](subbed.mp4).

Output

subbed.mp4 1.9 MB · h264 1280x720, 10.0s

CodexWith deft, skill as AGENTS.mdPassed2026-11-05

Time
15s
New tokens
7.3k
Total input
66.3k
Output tokens
0.3k
Commands
3
Failed
0

Trace

  1. I’ll use the `video-chinese-subtitles` skill’s subtitle workflow and write the burned-in video in the current directory.

  2. cat ~/.codex/skills/video-chinese-subtitles/SKILL.md && deft subtitle --help && deft video --help
    output
    ---
    name: video-chinese-subtitles
    description: Download a video or use a local source, translate its speech into Simplified Chinese, burn readable Chinese subtitles into the actual picture, and deliver the finished file. Use for requests for Chinese-subtitled videos, including batches; this skill does not publish videos to social accounts.
    ---
    
    # Video Chinese Subtitles
    
    Deliver the actual video with Chinese captions permanently visible, original audio and original picture geometry. An SRT sidecar or a selectable subtitle track alone does not satisfy this workflow.
    
    ## Complete the requested batch
    
    - Use the links, source files, destination and rights context already supplied. Honor existing authorization without repeatedly requesting confirmation. Download/edit permission does not imply public publication.
    - Work in a distinct workspace-contained artifact directory per video. Preserve the downloaded source, caption evidence and originals. Keep one writer per output path; after cancelling a process, confirm it exited before restarting.
    - Use current working yt-dlp, FFmpeg with libass, ffprobe and an installed CJK font. Prefer existing tools over writing a downloader. Check the actual local versions; an old package mirror can lag official yt-dlp releases. Read [commands and recovery](references/commands.md) for the operational steps.
    - Complete all requested videos. Split long files only to meet the destination's actual limit, using natural chapter or phrase boundaries. Never 
    … 6924 more characters
  3. deft subtitle burn --help && deft video info bunny.mp4 && deft subtitle info talk.srt
    output
    deft subtitle burn - Add subtitles: burned into the picture, or --soft
    Same as: deft video add-subtitles
    
    Usage: deft subtitle burn <video>... [-o <video|dir>] [options]
    In: video (each handled separately)   Out: video (default <name>.subtitled.<ext>)
    Burned subtitles use this machine's fonts, so Chinese and other scripts work.
    --soft adds a track the viewer can turn off (no re-encoding).
    
    Options:
      --subtitles <path>           An .srt or .vtt file (required)
      --soft                       Add a selectable track instead of burning in
      --font-size <number>         Text size in pixels (default: 5% of the height)
      --color <color>              Text color (default white)
      --position <position>        bottom or top (default bottom)
      --font <text>                Font family
    Common: -o --force --dry-run --json -j   (deft help common)
    
    Examples:
      deft video add-subtitles clip.mp4 --subtitles talk.srt -o subbed.mp4
      deft subtitle burn clip.mp4 --subtitles zh.srt -o zh.mp4
      deft video add-subtitles clip.mp4 --subtitles talk.vtt --soft -o soft.mp4
    
    Result fields: cues
    Needs: ffmpeg, ffprobe
    ok video.info bunny.mp4  0:10, 1280x720
    bitrate=775360 duration=10.0 fps=30.0 height=720 video_codec=h264 width=1280
    ok subtitle.info talk.srt  3 lines, 0:00.500 to 0:09.500
    chars=79 cues=3 first=0.5 last=9.5
  4. deft subtitle burn bunny.mp4 --subtitles talk.srt -o subbed.mp4
    output
    ok video.add-subtitles bunny.mp4 -> subbed.mp4  3 lines burned in  2.75s
  5. Burned the subtitles into the video and saved [subbed.mp4](subbed.mp4).

Output

Its files were not kept in this run. The last line of the trace is its own report.

Claude Opus 5.5Without deftPassed2026-11-07

Time
27s
New tokens
12.4k
Total input
108.4k
Output tokens
1.1k
Commands
0
Failed
0

Trace

    Output

    subbed.mp4 3.6 MB · h264 1280x720, 10.0s

    Claude Opus 5.5With deft, skill installedPassedRead the skillUsed deft2026-11-07

    Time
    12s
    New tokens
    10.7k
    Total input
    76.5k
    Output tokens
    0.5k
    Commands
    0
    Failed
    0

    Trace

      Output

      ---
      name: deft
      description: "Use deft first for any simple, direct operation on local files, whatever the type: convert, read, extract, edit, compress, merge, split, compare or inspect. Try it before writing a script or one-liner. If unsure, run deft find; if it says no command does this, use another tool. Not for programming work: to read, write or change source code, skip it."
      ---
      
      # deft
      
      One local command for file jobs. Prefer it over writing Python or shell scripts.
      
      Syntax: `deft <group> <command> [inputs] [-o output] [--options]`
      
      Groups:
      - `pdf`: Merge, split, compress, encrypt, forms, OCR, compare, convert
      - `image`: Resize, crop, convert, compress, adjust, montage, OCR
      - `video`: Trim, merge, convert, compress, subtitles, GIF, frames (ffmpeg)
      - `audio`: Convert, trim, normalize, denoise, cut silence (ffmpeg)
      - `doc`: Word/ODT/RTF: to text, Markdown, HTML, PDF; find and replace
      - `slides`: PowerPoint: extract text, Markdown outline
      - `sheet`: Excel/CSV/ODS tables: SQL query, pivot, merge, split, convert
      - `json`: JSON: convert, format, merge, diff, validate
      - `toml`: TOML: convert, format, merge, diff, validate
      - `xml`: XML: convert, format, merge, diff, validate
      - `yaml`: YAML: convert, format, merge, diff, validate
      - `md`: Markdown to PDF, HTML, Word, EPUB; table of contents
      - `html`: HTML to Markdown, text, Word and PDF
      - `epub`: E-books: info, to text, Markdown and PDF
      - `gps`: GPX and KML tracks: convert, distance and time
      - `qr`: Create QR codes and barcodes; read QR codes
      
      How to use it:
      1. Run `deft <group>` to list commands, or `deft find "<what you want>"` to search. If it says `no command does this`, use another tool.
      2. Run `deft <group> <command> --help` for options and examples.
      3. `deft convert <in> -o <out.ext>` converts between formats by extension.
      4. Results are one line starting with `ok`, `partial` or `error`; add `--json` to parse them. Errors include a `hint:` with the fix.
      
      Inputs are never overwritten; pass `--force` or `--in-place` to allow it. Globs and directories work as inputs; several inputs run in parallel.
      
      If `deft` is not installed, ask the user, then follow https://github.com/firstprayer/deft/blob/main/docs/INSTALL.md
      
      subbed.mp4 1.9 MB · h264 1280x720, 10.0s

      Claude CodeWithout deftNot run yet

      Claude CodeWith deftNot run yet