3 #=======================================================================
5 # File ID: 3a208946-50bb-11e6-8515-02010e0a6634
7 # Fix timestamp difference between .mp4 and .srt in AutoGuard
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #=======================================================================
25 " -n "$progname" -- "$@
")"
26 test "$?" = "0" ||
exit 1
34 -h|
--help) opt_help
=1; shift ;;
35 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
36 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
37 --version) echo $progname $VERSION; exit 0 ;;
39 *) echo $progname: Internal error
>&2; exit 1 ;;
42 opt_verbose
=$
(($opt_verbose - $opt_quiet))
44 if test "$opt_help" = "1"; then
45 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
48 Fix timestamp difference between .mp4 and .srt in AutoGuard (dash camera
49 app for Android). Sometimes there is a difference of 1 second between
50 the .mp4 and .srt file, and when they've been processed with datefn(1),
51 the subtitles (GPS coordinates and timestamp) disappear.
53 Usage: $progname [options] AG_FILES [...]
60 Be more quiet. Can be repeated to increase silence.
62 Increase level of verbosity. Can be repeated.
64 Print version information.
71 echo "$f" |
grep -q 20.._.._.._.._.._..
\\.mp4\$ ||
continue
72 base
="$(basename "$f" .mp4)"
73 if test -e "$base.srt"; then
74 echo touch -r "$base.mp4" "$base.srt"
75 touch -r "$base.mp4" "$base.srt"