Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 YouTube Shorts Generator

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.

Output format (per Short)

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

How it works

  1. Transcribe the whole video with faster-whisper (word-level timestamps).
  2. Analyze the transcript and score every ~30s window by information density, hook words, questions, numbers, and named entities.
  3. Select the top 1–3 non-overlapping segments.
  4. Render each as a 1080×1920 H.264/AAC Short (blurred fill background + centered frame, optional burned-in captions).
  5. Generate clickbait title / description / tags — via an OpenAI model if a key is supplied, otherwise built-in offline heuristics.

Prerequisites

  • FFmpeg (ffmpeg and ffprobe on PATH)
  • Python 3.11 (recommended for ML wheels)

Setup

# From the project folder
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Run

streamlit run app.py

Then 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.

Optional: better AI copy (Azure OpenAI + Entra ID)

Generate higher-quality titles/descriptions/tags with an Azure OpenAI model authenticated via Microsoft Entra ID (no API key required):

  1. Sign in: az login
  2. Ensure your identity has the Cognitive Services OpenAI User role on the Azure OpenAI resource.
  3. 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.

About

JBShorts — An AI-powered app that analyzes any long MP4 end-to-end and auto-generates 1–3 vertical YouTube Shorts (1080×1920, H.264/AAC). It transcribes the video, finds the most engaging moments, adds captions, and writes a clickbait title, description, and copy-ready tags for each Short.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages