From 14a972b2a4408b354d7618b982029286022a1c0d Mon Sep 17 00:00:00 2001 From: Sam Sneed <163201376+sam-sneed@users.noreply.github.com> Date: Sat, 15 Jun 2024 20:20:35 +0000 Subject: [PATCH] Add files via upload --- make_video_personal.sh | 5 +++++ renderer_personal.sh | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 make_video_personal.sh create mode 100644 renderer_personal.sh diff --git a/make_video_personal.sh b/make_video_personal.sh new file mode 100644 index 0000000..1aa7faa --- /dev/null +++ b/make_video_personal.sh @@ -0,0 +1,5 @@ +TITLE=$(ollama run "sparksammy/samantha-v3-uncensored" "create exactly 1 topic for a nerdy tech youtube video") +./scripter.sh "$TITLE" +./keywords2images.sh +espeak -f script.txt -w voice.wav +./renderer_personal.sh "$TITLE" diff --git a/renderer_personal.sh b/renderer_personal.sh new file mode 100644 index 0000000..0bf716d --- /dev/null +++ b/renderer_personal.sh @@ -0,0 +1,11 @@ +total_frames=$(wc -l < concat.txt) # Count the total number of frames in concat.txt +voice_length=$(ffprobe -i voice.wav -show_entries format=duration -v quiet -of csv="p=0") # Get the length of voice.wav + +# Calculate the correct duration of each frame +duration=$(echo "$voice_length / $total_frames" | bc) + +fps=$(echo "scale=2; $total_frames / $voice_length" | bc) + +# Use the corrected duration in the FFmpeg command +ffmpeg -r $fps -f concat -safe 0 -i concat.txt -i voice.wav -c:v libx264 -c:a aac -vf "setpts=PTS/1" -pix_fmt yuv420p -shortest mv output_video.mp4 ~/yt-drive/"$1.mp4" +