Readme
OpenShorts: long video to short vertical clips
Give it a long video (an upload, a direct link, or a YouTube link). It finds the best moments, reframes them to 9:16 around the speaker, and returns ready-to-post clips. Each clip also comes with an editable layer: captions with word timings, a hook text and an assets track. An app can edit and re-export the clip in the browser without running the model again.
Bring your own keys: gemini_api_key picks the moments and writes titles. ElevenLabs (elevenlabs_api_key) is only needed for dubbing. Keys are secret inputs, used only for your prediction and masked in the logs.
Runs on an Nvidia H100. It has no hardware video encoder, so clips render on the CPU: cottom/openshorts (L40S) is faster and cheaper for this model.
Output
A list of files. metadata.json describes all of them. Match the other URLs to it by file name, because the list order is not guaranteed:
clip_NN.mp4: publish-ready, with captions and hook burned in (whenburn_inis on)clean_NN.mp4: the same clip with nothing burned in, the base for an editorclip_NN.jpg: a poster frameclip_NN_<lang>.mp4: dubbed (withdub_language)
Per clip, metadata.json holds the title, hook, descriptions, source start/end, word timings, and an edit object (schema openshorts.edit/1) with the caption, hook and overlay layers. Replicate deletes output files after about an hour, so copy them to your own storage.
Progress and errors
The logs carry machine-readable lines, [openshorts:progress] {"stage": ...}: downloading, transcribing (percent), rendering, clip_ready, done. A failed prediction’s error starts with a code:
[youtube_blocked]: YouTube bot-checked the server. Passyoutube_cookies, a residentialproxy_url, or upload the file.[source_unavailable]: the video is private, removed or locked.[no_clips]: nothing clip-shaped was found.[invalid_api_key][gpu_error][transient]: already retried once inside the job.[timeout]: no clip finished in time.[pipeline_error]
Replicate stops a prediction after 30 minutes. The model stops itself at 26 minutes and returns the clips already finished ("partial": true in metadata.json).
Tips
- YouTube often bot-checks cloud servers. The most reliable input is a file (
video) your app downloaded, or a direct link to one. burn_in: falseskips the burned render: faster, for apps that edit in the browser.max_source_minutescaps cost on long videos.