extract-thumbnail script improved
[video-handling.git] / cut-mts
1 #!/bin/bash
2 #
3 # Calin-Andrei Burloiu, 2010, calin.burloiu@gmail.com
4 #
5 # This script cuts .mts video file starting from a seek point  
6 # with a desired duration. Seek point and duration are expressed in 
7 # seconds or in the hh:mm:ss[.xx] format.
8 #
9
10 if test $# -ne 4; then
11     echo "Usage: $0 mts-input-file mts-output-file seek-point duration"
12     exit 1
13 fi
14
15 MTS_IN="$1"
16 MTS_OUT="$2"
17 SEEK_POINT="$3"
18 DURATION="$4"
19 FFMPEG=/usr/bin/ffmpeg
20
21 if test ! -f "$MTS_IN"; then
22     echo "Error: No such file $MTS_IN"
23     exit 1
24 fi
25
26 "$FFMPEG" -ss "$SEEK_POINT" -t "$DURATION" -i "$MTS_IN" -f mpegts -acodec copy -vcodec copy "$MTS_OUT"