Skip to content

Add video support (--video) to clip/dub and a new caption command#139

Merged
alexkroman merged 2 commits into
mainfrom
claude/focused-knuth-qpnug0
Jun 12, 2026
Merged

Add video support (--video) to clip/dub and a new caption command#139
alexkroman merged 2 commits into
mainfrom
claude/focused-knuth-qpnug0

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

URL sources (YouTube/media pages) were always downloaded audio-only, so
clip cut audio clips from videos and dub had no URL path at all. Now:

  • youtube.download_audio becomes download_media with a video flag:
    video=True fetches best video+audio merged to mp4. A shared
    validate_video_flag rejects --video for local sources (their video is
    already operated on directly, and a requested flag is never dropped
    silently).
  • assembly clip --video downloads the full video for a URL source, so
    the clips are cut from the video.
  • assembly dub gains URL sources (mirroring clip's download-then-process
    flow, default output in the cwd) and --video, so the dub keeps the
    picture.
  • New assembly caption command: transcribe (or reuse a transcript with
    -t), fetch the SRT export, and burn open captions into the video with
    ffmpeg's subtitles filter (audio copied untouched; explicit -map 0:v
    makes audio-only input a clean error instead of a silent uncaptioned
    copy). --chars-per-caption and --font-size shape the captions; URL
    sources always download the full video.

https://claude.ai/code/session_01Vie2WKBt5zjUWwLbxp9BpN

claude and others added 2 commits June 12, 2026 23:31
URL sources (YouTube/media pages) were always downloaded audio-only, so
clip cut audio clips from videos and dub had no URL path at all. Now:

- youtube.download_audio becomes download_media with a video flag:
  video=True fetches best video+audio merged to mp4. A shared
  validate_video_flag rejects --video for local sources (their video is
  already operated on directly, and a requested flag is never dropped
  silently).
- assembly clip --video downloads the full video for a URL source, so
  the clips are cut from the video.
- assembly dub gains URL sources (mirroring clip's download-then-process
  flow, default output in the cwd) and --video, so the dub keeps the
  picture.
- New assembly caption command: transcribe (or reuse a transcript with
  -t), fetch the SRT export, and burn open captions into the video with
  ffmpeg's subtitles filter (audio copied untouched; explicit -map 0:v
  makes audio-only input a clean error instead of a silent uncaptioned
  copy). --chars-per-caption and --font-size shape the captions; URL
  sources always download the full video.

https://claude.ai/code/session_01Vie2WKBt5zjUWwLbxp9BpN
@alexkroman alexkroman enabled auto-merge June 12, 2026 23:32
@alexkroman alexkroman added this pull request to the merge queue Jun 12, 2026
Merged via the queue into main with commit c3a90a9 Jun 12, 2026
15 checks passed
@alexkroman alexkroman deleted the claude/focused-knuth-qpnug0 branch June 12, 2026 23:39
alexkroman pushed a commit that referenced this pull request Jun 13, 2026
…mediafile refactor

Reconciles the shared-scaffolding refactor with three upstream changes:
the language-native voice rotation (#136), the dub --video flag and the
new caption command (#139), and the exec-module splits (#138).

- run_dub keeps upstream's YouTube-download branch and _dub_and_emit
  split, with this branch's early validation (--voice parse, URL echo,
  out-path checks) threaded through; the parsed --voice pair rides in a
  frozen _VoicePlan.
- caption_exec now uses the shared mediafile helpers too (it had copied
  the same scaffolding), which also gives caption the upfront out-path
  validation, the samefile self-overwrite guard, the transcript status
  check, and the './-' ffmpeg path hardening.
- mediafile grows the caption-shaped pieces: validate_out (hoisted from
  dub_exec), a general resolve_transcript (diarized variant delegates),
  a kind= parameter for validate_local_media, and a suggestion override
  for ffmpeg_failure.
- test_dub_pipeline's YouTube-source tests move to test_dub_sources.py
  to stay under the 500-line file gate.

https://claude.ai/code/session_018TuAQTvp9PVy5EdhsDWo2h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants