blob: 287f52ccd804a5c7624de472e7414fdd8197c2c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#!/bin/bash
#
# Date: 2009-11-30
# Author: Ole Kristian Lien
# License: GNU General Public License
#
# Cut video from x to y (seconds or hh:mm:ss).
# Default duration, is the rest of the video.
EXT=`echo "$1"|awk -F . '{print $NF}'`
NAME=`basename $1 .$EXT`
if [ -z "$3" ]; then
echo "Usage: $0 <video-file> <new-video-file> <start-pos> [<duration>]"
exit 1
fi
if [ -z "$4" ]; then
DURATION=`./duration $1`
ffmpeg -i $1 -ss $3 -t $DURATION -vcodec copy -acodec copy $NAME-new.$EXT
else
ffmpeg -i $1 -ss $3 -t $4 -vcodec copy -acodec copy $NAME-new.$EXT
fi
|