Commit cbc4f036 authored by Milan Santosi's avatar Milan Santosi

should be done now.

Signed-off-by: default avatarMilan Santosi <milan.santosi@gmail.com>
parent b32d635a
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
# dirty little script to split a video into 15 minutes parts with ten # dirty little script to split a video into 15 minutes parts with ten
# seconds overlap (for upload to youtube) # seconds overlap (for upload to youtube)
# Author: milan <milan.santosi@gmail.com>
#
# USAGE: read comments and adjust where necessary, then: # USAGE: read comments and adjust where necessary, then:
# ./ffmpeg_splitter.sh <inputfile> # ./ffmpeg_splitter.sh <inputfile>
#################################################################### ####################################################################
...@@ -25,13 +26,16 @@ else ...@@ -25,13 +26,16 @@ else
fi fi
# get length and calculate amount of segments # get length of the original video, calculate amount of segments and
let vidlen=$(ffprobe -show_format $1 | grep duration | cut -d "." -f 1 | cut -d "=" -f 2)+1 # combined length of all parts (with overlap)
let segcount=$vidlen/890 let vidlen=$(ffprobe -show_format $bname-keyframes.$ext | grep duration | cut -d "." -f 1 | cut -d "=" -f 2)
let segcount=$vidlen/900
let withoverlap=$vidlen+$segcount*10
let newsegcount=$withoverlap/900
# loop until it's done # loop until it's done (actually one more time, just to make sure)
for (( i = 1; i <= $segcount; i++)) for (( i = 1; i <= $newsegcount+1; i++))
do do
ffmpeg -vcodec copy -acodec copy -ss $[i*890 - 890] -t 899.999 -i $bname-keyframes.$ext $bname-part0$i.$ext ffmpeg -vcodec copy -acodec copy -ss $[i*890 - 890] -t 899.999 -i $bname-keyframes.$ext $bname-part0$i.$ext
done done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment