From 11317e7391ce8175df6f1e4eca60a6bf0aefea61 Mon Sep 17 00:00:00 2001
From: Milan Santosi <milan.santosi@gmail.com>
Date: Tue, 17 Apr 2012 03:39:12 +0200
Subject: [PATCH] needed something to split arbitrary videos into 15 minute
 parts for upload to youtube.

Signed-off-by: Milan Santosi <milan.santosi@gmail.com>
---
 kiss/ffmpeg_splitter.sh | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100755 kiss/ffmpeg_splitter.sh

diff --git a/kiss/ffmpeg_splitter.sh b/kiss/ffmpeg_splitter.sh
new file mode 100755
index 0000000..6e704f6
--- /dev/null
+++ b/kiss/ffmpeg_splitter.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# very dirty script to split a video into 15 minutes parts with ten
+# seconds overlap (for upload to youtube)
+
+# USAGE: read comments and adjust where necessary, then:
+# ./ffmpeg_splitter.sh <inputvideofile>
+####################################################################
+
+
+# see http://linuxgazette.net/18/bash.html
+fname=$1           # the file name
+bname=${fname%%.*} # the file basename
+ext=${fname#*.}    # the file extension
+
+
+# first, re-encode with every frame as keyframe
+ffmpeg -g 1 -i  cstex81-session01-100-new2.wmv   
+
+
+
+for i in {1..5}  # Assumption that no video is longer than 5*15=75min
+do                                                                     
+    ffmpeg -vcodec copy -acodec copy -ss $[i*890 - 890] -t 899.999 -i $1 ${$1%%.*}-part0$i.$(echo $1 | sed 's/.*\.//')
+done
+
+
-- 
GitLab