Skip to content

Instantly share code, notes, and snippets.

@k1000
Last active July 25, 2016 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k1000/161ee686c42ad6bade75c0a2528022bf to your computer and use it in GitHub Desktop.
Save k1000/161ee686c42ad6bade75c0a2528022bf to your computer and use it in GitHub Desktop.
Split an input video into multiple output video chunks
#!/bin/bash
START=$(date +%s);
filename=$(basename "$1")
segment_times=$2
extension="${filename##*.}"
filename="${filename%.*}"
output=$filename_%d.$extension
ffmpeg -i "$1" -f segment -segment_times "$segment_times" -vcodec copy -acodec copy "$output"
END=$(date +%s);
echo ""
echo $((END-START)) | awk '{print int($1/60)":"int($1%60)}'
echo "`date +%Y-%m-%H_%M:%M` $1" >> ~/capture-log.txt