Skip to content

numbpilled2133/autotrend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

autotrend

AI-powered YouTube video assembler. Point it at a folder of clips/photos and a text script, get a 5–10 minute MP4 back.

autotrend ./media/ script.txt -o video.mp4

what it does

  1. segments your script by paragraph into voiceable chunks
  2. generates TTS audio for each segment (Microsoft Edge TTS — no API key needed)
  3. assigns your media files round-robin to each segment, trimming or looping as needed
  4. pads silence between segments automatically if the total would fall under 5 minutes
  5. assembles everything into a single 1920×1080 MP4 via ffmpeg
  6. optionally mixes in background music at a low volume

it has a full terminal UI: animated progress bars, media inventory table, segment plan table, per-stage spinners, and a final stats panel.


requirements

  • python 3.11+
  • uv — used to run the script with inline deps
  • ffmpeg + ffprobe in PATH
# arch
sudo pacman -S ffmpeg uv

# debian/ubuntu
sudo apt install ffmpeg && pip install uv

# mac
brew install ffmpeg uv

python dependencies are installed automatically by uv on first run: rich, typer, edge-tts


install

curl -o ~/.local/bin/autotrend https://raw.githubusercontent.com/numbpill3d/autotrend/main/autotrend
chmod +x ~/.local/bin/autotrend

or clone and symlink:

git clone https://github.com/numbpill3d/autotrend
ln -s $PWD/autotrend/autotrend ~/.local/bin/autotrend

usage

autotrend [OPTIONS] MEDIA_DIR SCRIPT_FILE

arguments

argument description
MEDIA_DIR folder containing your video clips and/or images
SCRIPT_FILE plain text file — the narration script

options

flag default description
-o, --output autotrend_output.mp4 output file path
-v, --voice en-US-AriaNeural edge-tts voice name
-m, --music background music file (any format ffmpeg accepts)
--music-vol 0.12 background music volume, 0.0–1.0
--min-dur 300 minimum target duration in seconds (5 min)
--max-dur 600 maximum target duration in seconds (10 min)
--ken-burns off slow zoom effect on images (cinematic, but slower to render)
--preview off show the segment plan without rendering anything
--keep-tmp off keep temp files after render (useful for debugging)

script format

write your narration as plain text. separate scenes/segments with a blank line:

This is the first scene. It will be read aloud and paired with your first media file.

This is the second scene. It gets the next media file, looping back around if you
have fewer files than paragraphs.

Short paragraphs get merged automatically. Very long ones get split at sentence
boundaries so nothing sounds rushed.

the tool targets 5–10 minutes. if your script is shorter, inter-segment silence is added proportionally. if it's longer, you'll get a warning but it'll still render.


examples

# basic
autotrend ./footage/ narration.txt -o my_video.mp4

# specific voice + background music
autotrend ./clips/ script.txt -o out.mp4 \
  --voice en-US-GuyNeural \
  --music lo-fi.mp3 --music-vol 0.10

# photos with ken burns zoom effect
autotrend ./photos/ script.txt --ken-burns -o cinematic.mp4

# preview the segment plan before committing to a full render
autotrend ./media/ script.txt --preview

# longer target (15 min)
autotrend ./media/ script.txt --min-dur 600 --max-dur 900

supported media formats

video: .mp4 .mov .avi .mkv .webm .m4v .flv

image: .jpg .jpeg .png .webp .bmp .tiff .gif

videos are preferred over images when both exist in the folder. all output is normalized to 1920×1080 @ 30fps, letterboxed/pillarboxed if needed.


voices

list all available TTS voices:

edge-tts --list-voices

some good defaults:

voice style
en-US-AriaNeural friendly, natural (default)
en-US-GuyNeural male, clear
en-GB-SoniaNeural british female
en-AU-NatashaNeural australian female
en-US-JennyNeural conversational

license

MIT

About

AI-powered YouTube video assembler — media folder + TTS script → 5-10 min MP4

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%