feat: video skill — an ffmpeg toolbox over a workspace clip - #11
Open
1Croydan1 wants to merge 1 commit into
Open
feat: video skill — an ffmpeg toolbox over a workspace clip#111Croydan1 wants to merge 1 commit into
1Croydan1 wants to merge 1 commit into
Conversation
Albert could already be handed a video (one sent as a document lands in the workspace with its path reported), but had nothing to open it with. This adds the tool side: read a clip's facts, take stills out of it, cut a piece, build a small looping preview, lift the audio track off, or shrink it to fit a chat. Speech is deliberately left to `transcribe`, which reads video containers directly — the skill points there instead of duplicating the pipeline. Conventions follow the existing skills: run through forkd, workspace-relative paths (forkd's cwd is the workspace), one JSON object on stdout, artifacts in the workspace root like imagegen's. Inputs are confined to the workspace, and outputs never clobber an earlier artifact. Tests: 20, all run. Seven cover the pure helpers (timestamp parsing refuses nonsense rather than silently seeking to zero; frame sampling stays off the usually-black edges; output naming avoids collisions and stays in the workspace). Thirteen drive the script as a subprocess exactly as forkd does, against clips ffmpeg builds on the spot — including the honest-failure paths: a silent clip, a moment past the end, a backwards range, a missing file, a path escaping the workspace. Green both locally (ffmpeg 8.1.1) and inside the deployed image (ffmpeg 6.1.1, Python 3.12.3). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Почему
Иван скинул Альберту видео — он не отреагировал. Причин оказалось две, и это вторая половина починки.
Первая — в octo: telegram-коннектор вообще не знает
video(LamantinAI/octo#9). Вторая — даже получив файл, Альберту нечем его открыть:ffmpegв образе есть, но ни один скилл им не пользуется.Этот PR добавляет инструментальную половину. Он полезен уже сейчас, не дожидаясь octo: видео, присланное документом, и сегодня кладётся в workspace с сообщённым путём.
Что умеет
infohas_audio— дёшево, до любого решенияframes--atраскидывает--count(по умолчанию 3) по клипу, обходя начало и конец, где обычно чернотаclipgifaudio.m4acompressmet_targetРечь намеренно не здесь. Скилл
transcribeуже читает видеоконтейнеры — SKILL.md отправляет туда с тем же путём, вместо дублирования пайплайна.Договорённости
Как у существующих скиллов: запуск через forkd, пути workspace-относительные (forkd даёт
cwd= workspace), один JSON-объект в stdout, артефакты в корне workspace — как у imagegen. Вход ограничен workspace, выход никогда не затирает предыдущий артефакт.Документирована и честная граница: извлечённые кадры — файлы, и сам Альберт их не видит (его зрение — только Blob от коннектора,
cogitator.rs). Их можно отправить пользователю черезchat.send_file; поэтому же в octo-PR превью едет блобом, а не путём.Тесты
20, все прогнаны.
Зелёные и локально (ffmpeg 8.1.1, Python 3.11), и внутри задеплоенного образа (ffmpeg 6.1.1, Python 3.12.3) — версии ffmpeg разошлись на две мажорки, поэтому проверял обе.
Ветка собрана от актуального
origin/main(f72a582). Rust не тронут — только файлы скилла.🤖 Generated with Claude Code