Chat spike clipper
When something crazy happens on stream, chat floods. This cuts a clip at every flood.
1. Get the stream and its chat
TwitchDownloader is free and open source (MIT). Download the VOD as mp4 and the chat as JSON.
2. The prompt
Write me a Python script called chat_clips.py. Input: a stream VOD (mp4) and its chat as JSON from TwitchDownloader (comments[].content_offset_seconds). Count chat messages in 10 second bins. Take the median bin as normal. Any bin with 3x normal or more is a spike. Keep the biggest spike in each 45 second window, top 10 overall. For each spike, cut a 45 second clip starting 20 seconds BEFORE the spike (chat reacts after the moment), crop to vertical 9:16 at 1080x1920 with ffmpeg, transcribe it with whisper.cpp and burn the captions in. Print each clip's timestamp, message count and how many times above normal it was. Use only ffmpeg and the Python standard library.
3. Or skip the prompt
The script Claude wrote for me: chat_clips.py (needs Python 3 and ffmpeg; whisper.cpp for captions).
python chat_clips.py chat.json vod.mp4
Clips start 20 seconds before each spike, because chat reacts after the moment.
Only clip streamers who allow it.