Add simple, production-ready FFmpeg helper script for Phoenix Salon Reels
This commit is contained in:
@@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# ============================================
|
||||||
|
# Phoenix Salon - Simple FFmpeg Helper Commands
|
||||||
|
# Production-ready, no over-engineering
|
||||||
|
# ============================================
|
||||||
|
|
||||||
|
# 1. Quick clip from raw footage (start time + duration)
|
||||||
|
clip() {
|
||||||
|
ffmpeg -i "$1" -ss "$2" -t "$3" -c:v libx264 -preset fast -crf 18 -c:a aac -b:a 128k "${4:-clip.mp4}"
|
||||||
|
echo "✅ Clipped: ${4:-clip.mp4}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 2. Burn clean subtitles (SRT file)
|
||||||
|
burn_subtitles() {
|
||||||
|
ffmpeg -i "$1" -vf "subtitles=$2:force_style='FontSize=48,PrimaryColour=&HFFFFFF&,OutlineColour=&H000000&,BorderStyle=3,Outline=2,Shadow=0'" -c:v libx264 -preset fast -crf 18 -c:a copy "${3:-with_subs.mp4}"
|
||||||
|
echo "✅ Subtitles burned: ${3:-with_subs.mp4}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 3. Resize to perfect vertical 9:16 for Reels/TikTok
|
||||||
|
make_vertical() {
|
||||||
|
ffmpeg -i "$1" -vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -preset fast -crf 18 -c:a aac -b:a 128k "${2:-vertical.mp4}"
|
||||||
|
echo "✅ Made vertical 9:16: ${2:-vertical.mp4}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 4. Add logo (bottom center, with padding)
|
||||||
|
add_logo() {
|
||||||
|
ffmpeg -i "$1" -i "$2" -filter_complex "[1]scale=280:-1[logo];[0][logo]overlay=(W-w)/2:H-h-120" -c:v libx264 -preset fast -crf 18 -c:a copy "${3:-with_logo.mp4}"
|
||||||
|
echo "✅ Logo added: ${3:-with_logo.mp4}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# 5. Full simple export (optimized for Instagram/TikTok)
|
||||||
|
export_reel() {
|
||||||
|
ffmpeg -i "$1" -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 128k -movflags +faststart "${2:-final_reel.mp4}"
|
||||||
|
echo "✅ Exported optimized reel: ${2:-final_reel.mp4}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Quick usage examples:
|
||||||
|
# clip raw.mp4 00:00:12 00:00:18 best_part.mp4
|
||||||
|
# burn_subtitles clip.mp4 captions.srt final.mp4
|
||||||
|
# make_vertical final.mp4 reel.mp4
|
||||||
|
# add_logo reel.mp4 logo.png branded.mp4
|
||||||
|
# export_reel branded.mp4 phoenix-reel.mp4
|
||||||
Reference in New Issue
Block a user