Skip to content

Transcode chat videos with their sound, in the jail or the app's sandbox (GRYT-1669) - #47

Merged
sivert-io merged 1 commit into
mainfrom
claude/GRYT-1669-chat-video-transcode
Oct 5, 2026
Merged

sivert-io merged 1 commit into
mainfrom
claude/GRYT-1669-chat-video-transcode

Conversation

@sivert-io

Copy link
Copy Markdown
Member

The worker half of Gryt-chat/server#277.

  • A quarantined video under uploads/ is a chat video. runChatVideoJob writes it out again as uploads/{id}.mp4 with a poster, or refuses it.
  • Docker (transcodeChatVideo): AV1 (SVT, preset 10, CRF 38) and stereo AAC 128k in MP4. Every frame is scaled into 1280px keeping its shape, at most 30 fps (-fpsmax). Only the first audio track is kept, and only if there is one. No metadata, chapters, subtitles or data streams. Ten-minute limit.
  • Desktop: chatVideoOnDesktop asks the app's sandbox for a chatvideo job (client PR alongside), and checkChatVideoAnswer checks the answer like every other one.
  • The worker claims chatvideo-v1 where the jail or the app sandbox works.
  • Dockerfile: ffmpeg gains audio. Decoders aac, mp3, opus, vorbis, flac and PCM; the matching parsers; the AAC encoder; swresample (was disabled); and the aresample, aformat and anull filters. Still the same jail, protocols and demuxers.

Tested in the built image: withaudio.mp4, H.264, the resizing WebM, HEVC, MOV, a portrait phone video (comes out 720×1280) and an 8K VP9 all converted in under a second, with AAC audio where the source had sound. HLS-as-mp4, random bytes and a truncated MP4 were refused. 61 unit tests pass.

What to look at: the bigger ffmpeg surface (audio decoders and swresample) in the Dockerfile. It runs in the same jail.

Review-required (image-worker).

🤖 Generated with Claude Code

@sivert-io
sivert-io merged commit 629981a into main Oct 5, 2026
7 checks passed
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.

1 participant