Created
March 13, 2014 02:11
-
-
Save yairsz/9520741 to your computer and use it in GitHub Desktop.
Bash Script to Cut up pieces of video files in a directory using FFMPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILES="/Users/yair/Movies/SoundsOfThePlanets/*.mp4" | |
#this script creates small pieces of videos out of a directory of .mp4 | |
i=0 | |
for f in $FILES | |
do | |
echo "Processing $f file..." | |
i=`expr $i + 1` | |
# take action on each file. $f store current file name | |
for num in {1..13} | |
do | |
echo "Number: $num" | |
#set the start time of each piece and run ffmpeg | |
START=`expr $num \* 22` | |
ffmpeg -i "$f" -vcodec copy -acodec copy -ss $START -t 0.865 grains/$i-$num.mp4 | |
done | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment