Analyze a long MP4 end-to-end and automatically produce 1–3 vertical YouTube Shorts, each with a clickbait title, description, and tags ready to copy.
| Property | Value |
|---|---|
| Resolution | 1080 × 1920 |
| Aspect ratio | 9:16 (vertical) |
| Duration | ~15–60s (target 30s) |
| Video codec | H.264 |
| Audio codec | AAC |
Generated copy respects the requested limits:
- Title — ≤ 90 characters, clickbait
- Description — ≤ 3200 characters
- Tags — comma-separated, no
#, easy to copy
- Transcribe the whole video with
faster-whisper(word-level timestamps). - Analyze the transcript and score every ~30s window by information density, hook words, questions, numbers, and named entities.
- Select the top 1–3 non-overlapping segments.
- Render each as a 1080×1920 H.264/AAC Short (blurred fill background + centered frame, optional burned-in captions).
- Generate clickbait title / description / tags — via an OpenAI model if a key is supplied, otherwise built-in offline heuristics.
- FFmpeg (
ffmpegandffprobeon PATH) - Python 3.11 (recommended for ML wheels)
# From the project folder
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtstreamlit run app.pyThen either paste a local file path (best for large files) or upload a video, pick your settings in the sidebar, and click Analyze & Create Shorts.
Generate higher-quality titles/descriptions/tags with an Azure OpenAI model authenticated via Microsoft Entra ID (no API key required):
- Sign in:
az login - Ensure your identity has the Cognitive Services OpenAI User role on the Azure OpenAI resource.
- In the sidebar, enter your endpoint (
https://<resource>.openai.azure.com) and the chat model deployment name.
You can also set these via environment variables instead of the sidebar:
$env:AZURE_OPENAI_ENDPOINT = "https://<resource>.openai.azure.com"
$env:AZURE_OPENAI_DEPLOYMENT = "gpt-4o-mini"
# optional: $env:AZURE_OPENAI_API_VERSION = "2024-10-21"Without Azure OpenAI configured, the app is fully offline and uses transcript-driven heuristics.
Rendered Shorts are written to the output/ folder.