| m2vmp2cut-0.72/HISTORY | | m2vmp2cut-0.74/HISTORY |
| 1 | # Created using svn -v log | sed -n -e '${x;p;x;p;q};/^--*$/{x;/./p;d};x;p' | 1 | # Created using svn -v log | sed -n -e '${x;p;x;p;q};/^--*$/{x;/./p;d};x;p' |
| 2 | # This file is not version controlled | 2 | # This file is not version controlled |
| 3 | | 3 | |
| | 4 | ------------------------------------------------------------------------ |
| | 5 | r2192 | too | 2008-08-18 21:21:58 +0300 (Mon, 18 Aug 2008) | 1 line |
| | 6 | Changed paths: |
| | 7 | M /main/projects/m2vmp2cut/ANNOUNCE |
| | 8 | M /main/projects/m2vmp2cut/Makefile |
| | 9 | M /main/projects/m2vmp2cut/README |
| | 10 | M /main/projects/m2vmp2cut/VERSION |
| | 11 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.pl |
| | 12 | M /main/projects/m2vmp2cut/contrib/mpeg2.sh |
| | 13 | |
| | 14 | Version 0.74 |
| | 15 | ------------------------------------------------------------------------ |
| | 16 | r2191 | too | 2008-08-18 19:47:33 +0300 (Mon, 18 Aug 2008) | 1 line |
| | 17 | Changed paths: |
| | 18 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.sh |
| | 19 | A /main/projects/m2vmp2cut/contrib |
| | 20 | A /main/projects/m2vmp2cut/contrib/mpeg2.sh |
| | 21 | |
| | 22 | contrib work for initial release. |
| | 23 | ------------------------------------------------------------------------ |
| | 24 | r2190 | too | 2008-08-18 08:18:06 +0300 (Mon, 18 Aug 2008) | 1 line |
| | 25 | Changed paths: |
| | 26 | M /main/projects/m2vmp2cut/src/fileparts.c |
| | 27 | |
| | 28 | patch < ~/m2vmp2cut.off_t.patch (fileparts.c fix from G?\195?\182ran) |
| | 29 | ------------------------------------------------------------------------ |
| | 30 | r2188 | too | 2008-08-11 22:23:02 +0300 (Mon, 11 Aug 2008) | 1 line |
| | 31 | Changed paths: |
| | 32 | M /main/projects/m2vmp2cut/bin/getmp2.sh |
| | 33 | M /main/projects/m2vmp2cut/bin/getyuv.pl |
| | 34 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.sh |
| | 35 | M /main/projects/m2vmp2cut/tools/relhelper.sh |
| | 36 | |
| | 37 | contrib interface. tunes. |
| | 38 | ------------------------------------------------------------------------ |
| | 39 | r2187 | too | 2008-08-07 21:57:37 +0300 (Thu, 07 Aug 2008) | 1 line |
| | 40 | Changed paths: |
| | 41 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.sh |
| | 42 | |
| | 43 | help updates. |
| | 44 | ------------------------------------------------------------------------ |
| | 45 | r2186 | too | 2008-08-07 20:50:05 +0300 (Thu, 07 Aug 2008) | 1 line |
| | 46 | Changed paths: |
| | 47 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.sh |
| | 48 | |
| | 49 | m2vmp2cut.sh: file|dir in either side of command. getyuv and getmp2 commands. |
| | 50 | ------------------------------------------------------------------------ |
| | 51 | r2184 | too | 2008-08-06 19:44:49 +0300 (Wed, 06 Aug 2008) | 1 line |
| | 52 | Changed paths: |
| | 53 | M /main/projects/m2vmp2cut/bin/getmp2.sh |
| | 54 | M /main/projects/m2vmp2cut/bin/m2vmp2cut.pm |
| | 55 | |
| | 56 | getmp2.sh works now too. |
| | 57 | ------------------------------------------------------------------------ |
| | 58 | r2183 | too | 2008-08-06 18:22:17 +0300 (Wed, 06 Aug 2008) | 1 line |
| | 59 | Changed paths: |
| | 60 | M /main/projects/m2vmp2cut/bin/getmp2.sh |
| | 61 | M /main/projects/m2vmp2cut/bin/getyuv.pl |
| | 62 | |
| | 63 | '<directory>' in usage |
| | 64 | ------------------------------------------------------------------------ |
| | 65 | r2182 | too | 2008-08-06 17:53:50 +0300 (Wed, 06 Aug 2008) | 1 line |
| | 66 | Changed paths: |
| | 67 | M /main/projects/m2vmp2cut/bin/getyuv.pl |
| | 68 | |
| | 69 | getyuv.pl works now. |
| | 70 | ------------------------------------------------------------------------ |
| | 71 | r2181 | too | 2008-08-05 21:55:28 +0300 (Tue, 05 Aug 2008) | 1 line |
| | 72 | Changed paths: |
| | 73 | A /main/projects/m2vmp2cut/bin/getmp2.sh |
| | 74 | A /main/projects/m2vmp2cut/bin/getyuv.pl |
| | 75 | A /main/projects/m2vmp2cut/bin/m2vmp2cut.pm |
| | 76 | |
| | 77 | Some get(yuv|mp2).* and m2vmp2cut.pm code |
| 4 | ------------------------------------------------------------------------ | 78 | ------------------------------------------------------------------------ |
| 5 | r2177 | too | 2008-07-30 11:18:41 +0300 (Wed, 30 Jul 2008) | 1 line | 79 | r2177 | too | 2008-07-30 11:18:41 +0300 (Wed, 30 Jul 2008) | 1 line |
| 6 | Changed paths: | 80 | Changed paths: |
| m2vmp2cut-0.72/Makefile | | m2vmp2cut-0.74/Makefile |
| 29 | TRG_BINS = m2vcut-gui m2vfilter m2vscan m2vtoyuv mp2cutpoints \ | 29 | TRG_BINS = m2vcut-gui m2vfilter m2vscan m2vtoyuv mp2cutpoints \ |
| 30 | fileparts filerotate wavgraph warpxpointer \ | 30 | fileparts filerotate wavgraph warpxpointer \ |
| 31 | m2vmp2cut.pl m2vmp2cut.sh m2v_catfiltered.py m2v_somehdrinfo.py \ | 31 | m2vmp2cut.pl m2vmp2cut.sh m2v_catfiltered.py m2v_somehdrinfo.py \ |
| 32 | wrapper.sh lvev6frames.pl | 32 | wrapper.sh lvev6frames.pl getyuv.pl getmp2.sh m2vmp2cut.pm |
| 33 | | 33 | |
| 34 | #TRG_DOCS = Examples m2vcut_help-default m2vcut_help-fi_FI Options Usage | 34 | #TRG_DOCS = Examples m2vcut_help-default m2vcut_help-fi_FI Options Usage |
| 35 | TRG_DOCS = m2vcut_help-default m2vcut_help-fi_FI Options Usage | 35 | TRG_DOCS = m2vcut_help-default m2vcut_help-fi_FI Options Usage |
| 36 | | 36 | |
| 37 | chkfiles: | 37 | chkfiles: all |
| 38 | @for i in $(TRG_BINS:%=bin/%) $(TRG_DOCS:%=doc/%); \ | 38 | @for i in $(TRG_BINS:%=bin/%) $(TRG_DOCS:%=doc/%); \ |
| 39 | do test -f "$$i" || { echo "'$$i' missing"; exit 1; }; done | 39 | do test -f "$$i" || { echo "'$$i' missing"; exit 1; }; done |
| 40 | @test -f m2vmp2cut | 40 | @test -f m2vmp2cut |
| 44 | @chkdir() { [ -d "$$1" ] || mkdir -m 755 -p "$$1"; }; \ | 44 | @chkdir() { [ -d "$$1" ] || mkdir -m 755 -p "$$1"; }; \ |
| 45 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER); chkdir $(PREFIX)/bin; \ | 45 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER); chkdir $(PREFIX)/bin; \ |
| 46 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER)/bin; \ | 46 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER)/bin; \ |
| 47 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER)/doc | 47 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER)/doc; \ |
| | 48 | chkdir $(PREFIX)/lib/m2vmp2cut-$(VER)/contrib |
| 48 | cp $(TRG_BINS:%=bin/%) $(PREFIX)/lib/m2vmp2cut-$(VER)/bin | 49 | cp $(TRG_BINS:%=bin/%) $(PREFIX)/lib/m2vmp2cut-$(VER)/bin |
| 49 | cp $(TRG_DOCS:%=doc/%) $(PREFIX)/lib/m2vmp2cut-$(VER)/doc | 50 | cp $(TRG_DOCS:%=doc/%) $(PREFIX)/lib/m2vmp2cut-$(VER)/doc |
| | 51 | cp contrib/* $(PREFIX)/lib/m2vmp2cut-$(VER)/contrib |
| 50 | cp m2vmp2cut $(PREFIX)/bin/m2vmp2cut | 52 | cp m2vmp2cut $(PREFIX)/bin/m2vmp2cut |
| 51 | ln -s $(PJXJAR) $(PREFIX)/lib/m2vmp2cut-$(VER)/bin/ProjectX.jar | 53 | ln -s $(PJXJAR) $(PREFIX)/lib/m2vmp2cut-$(VER)/bin/ProjectX.jar |
| 52 | # v=$(VER); sed "s/=devel/=$$v/" m2vmp2cut > $(PREFIX)/bin/m2vmp2cut | 54 | # v=$(VER); sed "s/=devel/=$$v/" m2vmp2cut > $(PREFIX)/bin/m2vmp2cut |
| 136 | #,# VERSION | 138 | #,# VERSION |
| 137 | | 139 | |
| 138 | #,# bin | 140 | #,# bin |
| | 141 | #,# bin/getmp2.sh x |
| | 142 | #,# bin/getyuv.pl x |
| 139 | #,# bin/lvev6frames.pl x | 143 | #,# bin/lvev6frames.pl x |
| 140 | #,# bin/m2v_catfiltered.py x | 144 | #,# bin/m2v_catfiltered.py x |
| 141 | #,# bin/m2vmp2cut.pl x | 145 | #,# bin/m2vmp2cut.pl x |
| | 146 | #,# bin/m2vmp2cut.pm |
| 142 | #,# bin/m2vmp2cut.sh x | 147 | #,# bin/m2vmp2cut.sh x |
| 143 | #,# bin/m2v_somehdrinfo.py x | 148 | #,# bin/m2v_somehdrinfo.py x |
| 144 | #,# bin/wrapper.sh x | 149 | #,# bin/wrapper.sh x |
| | 150 | |
| | 151 | #,# contrib |
| | 152 | #,# contrib/mpeg2.sh x |
| 145 | | 153 | |
| 146 | #,# doc | 154 | #,# doc |
| 147 | #,# doc/Examples | 155 | #,# doc/Examples |
| m2vmp2cut-0.72/bin/m2vmp2cut.sh | | m2vmp2cut-0.74/bin/m2vmp2cut.sh |
| 7 | # All rights reserved | 7 | # All rights reserved |
| 8 | # | 8 | # |
| 9 | # Created: Wed Apr 23 21:40:17 EEST 2008 too | 9 | # Created: Wed Apr 23 21:40:17 EEST 2008 too |
| 10 | # Last modified: Wed Jul 23 12:03:42 EEST 2008 too | 10 | # Last modified: Mon Aug 18 19:25:06 EEST 2008 too |
| 11 | | 11 | |
| 12 | e2 () { echo "$@" >&2; } | 12 | e2 () { echo "$@" >&2; } |
| 13 | die () { e2 "$@"; exit 1; } | 13 | die () { e2 "$@"; exit 1; } |
| 14 | usage () { e2; e2 Usage: m2vmp2cut '(file|dir)' $cc "$@"; die; } | 14 | usage () { e2; e2 Usage: m2vmp2cut '[(file|dir)]' $cc '[(file|dir)]' "$@"; die; } |
| 15 | needvar () { [ x"$1" = x ] && { shift 1; "$@"; }; } | 15 | needvar () { [ x"$1" = x ] && { shift 1; "$@"; }; } |
| 16 | | 16 | |
| 17 | x () { echo + "$@"; "$@"; } | 17 | x () { echo + "$@"; "$@"; } |
| 26 | # no interactive behaviour in batch mode... | 26 | # no interactive behaviour in batch mode... |
| 27 | case $1 in --batch) batch=1; shift ;; *) batch= ;; esac | 27 | case $1 in --batch) batch=1; shift ;; *) batch= ;; esac |
| 28 | | 28 | |
| 29 | case $1 in ''|h|he|hel|help|vermatch) ;; | 29 | file= dir= |
| 30 | e|ex|exa|exam|examp|exampl|example) ;; | 30 | filedir () { |
| 31 | lve|lvev|lvev6|lvev6f|lvev6fr|lvev6fra|lvev6fram|lvev6frame|lvev6frames) ;; | 31 | case $dir in '') ;; *) return 1 ;; esac |
| | 32 | case "$1" in '') die m2vmp2cut $cm: file/directory arg missing ;; esac |
| 32 | *) if test -f "$1" | 33 | if test -f "$1" |
| 33 | then | 34 | then |
| 34 | dn=`dirname "$1"`; basename=`basename "$1"` | 35 | dn=`dirname "$1"`; basename=`basename "$1"` |
| 35 | od=`echo $basename | sed 's/\.[^.]*$//'`.d | 36 | od=`echo $basename | sed 's/\.[^.]*$//'`.d |
| 40 | else | 41 | else |
| 41 | die "'$1': not a file or directory" | 42 | die "'$1': not a file or directory" |
| 42 | fi | 43 | fi |
| 43 | shift ;; | 44 | return 0 |
| 44 | esac | 45 | } |
| | 46 | |
| | 47 | #case $1 in '') ;; *) test -f "$1" -o -d "$1" && { filedir "$1";shift; } ;; esac |
| 45 | | 48 | |
| 46 | # do not show this in command list | 49 | # do not show this in command list |
| 47 | cmd_vermatch () | 50 | cmd_vermatch () |
| 48 | { | 51 | { |
| 49 | case $1 in 5) exit 0;; *) exit 1 ;; esac | 52 | case $1 in 6) exit 0;; *) exit 1 ;; esac |
| 50 | } | 53 | } |
| 51 | | 54 | |
| 52 | cmd_lvev6frames () # Legacy m2vmp2cut support; dig cutpoints from ~/.lve/* file | 55 | cmd_lvev6frames () # Legacy m2vmp2cut support; dig cutpoints from ~/.lve/* file |
| 65 | | 68 | |
| 66 | cmd_demux () # Demux mpeg2 file with ProjectX for further editing... | 69 | cmd_demux () # Demux mpeg2 file with ProjectX for further editing... |
| 67 | { | 70 | { |
| 68 | case $file in '') | 71 | filedir "$1" && shift |
| 69 | die "No file to demux given" ;; | 72 | |
| 70 | esac | | |
| 71 | test -h $M2VMP2CUT_CMD_PATH/ProjectX.jar || { \ | 73 | test -h $M2VMP2CUT_CMD_PATH/ProjectX.jar || { \ |
| 72 | e2 Symbolic link \'$M2VMP2CUT_CMD_PATH/ProjectX.jar\' does not exist | 74 | e2 Symbolic link \'$M2VMP2CUT_CMD_PATH/ProjectX.jar\' does not exist |
| 73 | die Please provide link and try again | 75 | die Please provide link and try again |
| 89 | | 91 | |
| 90 | cmd_select () # Select parts from video with a graphical tool | 92 | cmd_select () # Select parts from video with a graphical tool |
| 91 | { | 93 | { |
| | 94 | filedir "$1" && shift |
| 92 | test -f "$dir/video.m2v" || die "'$dir/video.m2v' does not exist" | 95 | test -f "$dir/video.m2v" || die "'$dir/video.m2v' does not exist" |
| 93 | chkindexes "$dir" | 96 | chkindexes "$dir" |
| 94 | x $M2VMP2CUT_CMD_PATH/m2vcut-gui \ | 97 | x $M2VMP2CUT_CMD_PATH/m2vcut-gui \ |
| 99 | | 102 | |
| 100 | cmd_cut () # Cut using m2vmp2cut.pl for the work... | 103 | cmd_cut () # Cut using m2vmp2cut.pl for the work... |
| 101 | { | 104 | { |
| | 105 | filedir "$1" && shift |
| 102 | x $M2VMP2CUT_CMD_PATH/m2vmp2cut.pl --dir="$dir" "$@" | 106 | x $M2VMP2CUT_CMD_PATH/m2vmp2cut.pl --dir="$dir" ${1:+"$@"} |
| 103 | } | 107 | } |
| 104 | | 108 | |
| 105 | cmd_play () # Play resulting file with mplayer | 109 | cmd_play () # Play resulting file with mplayer |
| 106 | { | 110 | { |
| | 111 | filedir "$1" && shift |
| 107 | f="$dir"/m2vmp2cut-work/out.mpg | 112 | f="$dir"/m2vmp2cut-work/out.mpg |
| 108 | test -f "$f" || die "'$f' does not exist" | 113 | test -f "$f" || die "'$f' does not exist" |
| 109 | x mplayer "$@" "$f" | 114 | x mplayer ${1:+"$@"} "$f" |
| 110 | } | 115 | } |
| 111 | | 116 | |
| 112 | cmd_move () # Move final file to a new location (and name) | 117 | cmd_move () # Move final file to a new location (and name) |
| 113 | { | 118 | { |
| | 119 | filedir "$1" && shift |
| 114 | needvar "$1" usage '<destfile>' | 120 | needvar "$1" usage '<destfile>' |
| 115 | f="$dir"/m2vmp2cut-work/out.mpg | 121 | f="$dir"/m2vmp2cut-work/out.mpg |
| 116 | test -f "$f" || die "'$f' does not exist" | 122 | test -f "$f" || die "'$f' does not exist" |
| 117 | x mv "$f" "$1" | 123 | x mv "$f" "$1" |
| 118 | } | 124 | } |
| 119 | | 125 | |
| | 126 | cmd_getyuv () # get selected parts of mpeg2 video as yuv(4mpeg) frames |
| | 127 | { |
| | 128 | case $1 in examp*) exec $M2VMP2CUT_CMD_PATH/getyuv.pl examples ;; esac |
| | 129 | filedir "$1" && shift |
| | 130 | x $M2VMP2CUT_CMD_PATH/getyuv.pl "$dir" |
| | 131 | } |
| | 132 | |
| | 133 | cmd_getmp2 () # get selected parts of mp2 audio |
| | 134 | { |
| | 135 | case $1 in examp*) exec $M2VMP2CUT_CMD_PATH/getmp2.sh examples ;; esac |
| | 136 | filedir "$1" && shift |
| | 137 | x $M2VMP2CUT_CMD_PATH/getmp2.sh "$dir" |
| | 138 | } |
| | 139 | |
| | 140 | cmd_contrib () # contrib material, encoding scripts etc... |
| | 141 | { |
| | 142 | M2VMP2CUT_CMD_DIRNAME=`dirname "$M2VMP2CUT_CMD_PATH"` |
| | 143 | case $1 in '') |
| | 144 | echo |
| | 145 | echo Append one of these to your command line to continue. |
| | 146 | echo Unambiquous prefix will do... |
| | 147 | echo |
| | 148 | cd $M2VMP2CUT_CMD_DIRNAME/contrib |
| | 149 | ls -1 | while read line |
| | 150 | do |
| | 151 | sed -n '2 { s/./ '"$line"' / |
| | 152 | s/\(.\{16\}\) */\1/p; q; }' $line |
| | 153 | done |
| | 154 | echo; exit 0 |
| | 155 | esac |
| | 156 | for f in `ls -1 $M2VMP2CUT_CMD_DIRNAME/contrib` |
| | 157 | do |
| | 158 | case $f in |
| | 159 | $1) fp= ff=$1 fm=$1 break ;; |
| | 160 | $1*) fp=$ff; ff="$f $ff"; fm=$f ;; |
| | 161 | esac |
| | 162 | done |
| | 163 | case $ff in '') die "'$1': not found." ;; esac |
| | 164 | case $fp in '') ;; *) die "contrib: ambiquous match: $ff" ;; esac |
| | 165 | shift |
| | 166 | export M2VMP2CUT_CMD_DIRNAME |
| | 167 | $M2VMP2CUT_CMD_DIRNAME/contrib/$fm ${1:+"$@"} |
| | 168 | } |
| | 169 | |
| 120 | cmd_help () # Help of all or some of the commands above | 170 | cmd_help () # Help of all or some of the commands above |
| 121 | { | 171 | { |
| | 172 | case $1 in '') cut -d: -f 2- <<. |
| | 173 | : |
| | 174 | : Enter help <command-name> or '.' to see help of all commands at once. |
| | 175 | : |
| | 176 | : The <file>/<directory> argument can be given before or after the |
| | 177 | : command. Also, if <file> arg is given when <directory> is expected |
| | 178 | : the needed directory is tried to be deduced from given file name. |
| | 179 | : |
| | 180 | . |
| | 181 | exit 0 ;; esac |
| 122 | echo | 182 | echo |
| 123 | sed -n "s|^#h $1[^:]*:||p" "$0" | 183 | sed -n "s|^#h $1[^:]*:||p" "$0" |
| 124 | } | 184 | } |
| 128 | cut -d: -f 2- >&2 <<. | 188 | cut -d: -f 2- >&2 <<. |
| 129 | : | 189 | : |
| 130 | : Simple example commands. In select/cut/play '<dir>' can be used. | 190 | : Simple example commands. In select/cut/play '<dir>' can be used. |
| 131 | : (<file> is for user convenience...) | 191 | : (<file> is for user convenience...). |
| | 192 | : The <file>/<dir> option can also be given after command name... |
| 132 | : | 193 | : |
| 133 | : m2vmp2cut <file> demux | 194 | : m2vmp2cut <file> demux |
| 134 | : m2vmp2cut <file> select | 195 | : m2vmp2cut <file> select |
| 135 | : m2vmp2cut <file> cut | 196 | : m2vmp2cut <file> cut |
| 136 | : m2vmp2cut <file> play | 197 | : m2vmp2cut <file> play |
| 137 | : | 198 | : |
| 138 | : In above, there was basic workflow. 'cut' gui provides a test | 199 | : In above, there was basic workflow. 'select' gui provides a test |
| 139 | : option -- but if you want to re-test, run these. | 200 | : option -- but if you want to re-test, run these. |
| 140 | : | 201 | : |
| 141 | : m2vmp2cut <file> cut --test=200 | 202 | : m2vmp2cut <file> cut --test=200 |
| 142 | : m2vmp2cut <file> play | 203 | : m2vmp2cut <file> play |
| 143 | : | 204 | : |
| | 205 | : getyuv and getmp2 has their own examples. Enter 'example' to their |
| | 206 | : command lines to see those. |
| | 207 | : |
| 144 | . | 208 | . |
| 145 | } | 209 | } |
| 146 | | 210 | |
| 147 | # --- | 211 | # --- |
| 148 | | 212 | |
| 149 | [ x"$1" = x ] && { | 213 | case $1 in '') |
| 150 | echo | 214 | echo |
| 151 | echo Usage: m2vmp2cut '[-batch] (file|dir) <command> [args]' | 215 | echo Usage: m2vmp2cut '[-batch] [(file|dir)] <command> [(file|dir)] [args]' |
| 152 | echo | 216 | echo |
| 153 | echo m2vmp2cut commands available: | 217 | echo m2vmp2cut commands available: |
| 154 | echo | 218 | echo |
| 155 | sed -n '/^cmd_/ { s/cmd_/ /; s/ () [ -#]*/ / | 219 | sed -n '/^cmd_[a-z]/ { s/cmd_/ /; s/ () [ -#]*/ / |
| 156 | s/\(.\{15\}\) */\1/p; }' $0 | 220 | s/\(.\{15\}\) */\1/p; }' $0 |
| 157 | echo | 221 | echo |
| 158 | echo Commands may be abbreviated down to no ambiguity | 222 | echo Commands may be abbreviated down to no ambiguity |
| 159 | echo | 223 | echo |
| 160 | exit 0 | 224 | exit 0 ;; |
| 161 | } | 225 | esac |
| 162 | | 226 | |
| 163 | cmd=$1; shift | 227 | cmd=$1 cmd2=${2:-none} |
| 164 | | 228 | |
| 165 | #case $cmd in | 229 | #case $cmd in |
| 166 | # c) cmd=colorset ;; | 230 | # c) cmd=colorset ;; |
| 167 | #esac | 231 | #esac |
| 168 | | 232 | |
| 169 | | 233 | cc= cp= cm= cc2= cp2= cm2= |
| 170 | cc= cp= | | |
| 171 | for m in `LC_ALL=C sed -n 's/^cmd_\([a-z0-9_]*\) (.*/\1/p' $0` | 234 | for m in `LC_ALL=C sed -n 's/^cmd_\([a-z0-9_]*\) (.*/\1/p' $0` |
| 172 | do | 235 | do |
| 173 | case $m in | 236 | case $m in |
| 174 | $cmd) cp= cc=$cmd cm=$cmd; break ;; | 237 | $cmd) cp= cc=$cmd cm=$cmd; break ;; |
| 175 | $cmd*) cp=$cc; cc="$m $cc"; cm=$m ;; | 238 | $cmd*) cp=$cc; cc="$m $cc"; cm=$m ;; |
| | 239 | $cmd2*) cp2=$cc2; cc2="$m $cc2"; cm2=$m ;; |
| 176 | esac | 240 | esac |
| 177 | done | 241 | done |
| 178 | | 242 | |
| 179 | [ x"$cc" = x ] && { echo $0: $cmd -- command not found.; exit 1; } | 243 | case "$cc$cc2" in '') die $0: $cmd or $cmd2 -- command not found;; esac |
| 180 | | 244 | |
| 181 | [ x"$cp" != x ] && { echo $0: $cmd -- ambiquous command: matches $cc; exit 1; } | 245 | case $cp in '') ;; *) die $0: $cmd: -- ambiquous commands: matches $cc ;; esac |
| | 246 | case $cp2 in '') ;; *) die $0: $cmd2: -- ambiquous commands: matches $cc2;; esac |
| | 247 | |
| | 248 | case $cc in '') cm=$cm2; filedir "$1"; shift ;; esac |
| | 249 | shift |
| | 250 | unset cc2 cp2 cm2 cc cp |
| 182 | | 251 | |
| 183 | cmd=$cm | 252 | cmd=$cm |
| 184 | cmd_$cm "$@" | 253 | cmd_$cm ${1:+"$@"} |
| 185 | exit $? | 254 | exit $? |
| 186 | | 255 | |
| 187 | # fixme: move these to separate doc file (w/ locale extension) | 256 | # fixme: move these to separate doc file (w/ locale extension) |
| 193 | #h lvev6frames: these old edits can be used with this m2vmp2cut version | 262 | #h lvev6frames: these old edits can be used with this m2vmp2cut version |
| 194 | #h lvev6frames: | 263 | #h lvev6frames: |
| 195 | | 264 | |
| 196 | #h demux: <filename> demux | 265 | #h demux: demux <filename> |
| 197 | #h demux: | 266 | #h demux: |
| 198 | #h demux: m2vmp2cut reguires mpeg files to be demuxed to elementary streams | 267 | #h demux: m2vmp2cut reguires mpeg files to be demuxed to elementary streams |
| 199 | #h demux: before cutting. This command uses ProjectX to do the demuxing. | 268 | #h demux: before cutting. This command uses ProjectX to do the demuxing. |
| 202 | #h demux: source file. | 271 | #h demux: source file. |
| 203 | #h demux: | 272 | #h demux: |
| 204 | | 273 | |
| 205 | #h select: <directory> select | 274 | #h select: select <directory> |
| 206 | #h select: | 275 | #h select: |
| 207 | #h select: This command uses new m2vcut-gui graphical utility for searching | 276 | #h select: This command uses new m2vcut-gui graphical utility for searching |
| 208 | #h select: cutpoints. This work is done frame-accurately. | 277 | #h select: cutpoints. This work is done frame-accurately. |
| 209 | #h select: | 278 | #h select: |
| 210 | | 279 | |
| 211 | #h cut: <directory> cut [options] ... | 280 | #h cut: cut <directory> [options] ... |
| 212 | #h cut: | 281 | #h cut: |
| 213 | #h cut: This command is wrapper to m2vmp2cut.pl (which used to be the frontend | 282 | #h cut: This command is wrapper to m2vmp2cut.pl (which used to be the frontend |
| 214 | #h cut: of m2vmp2cut in old versions). This command has extensive help of | 283 | #h cut: of m2vmp2cut in old versions). This command has extensive help of |
| 216 | #h cut: when this creates final output file. | 285 | #h cut: when this creates final output file. |
| 217 | #h cut: | 286 | #h cut: |
| 218 | | 287 | |
| 219 | #h play: <directory> play [options] | 288 | #h play: play <directory> [options] |
| 220 | #h play: | 289 | #h play: |
| 221 | #h play: This command runs mplayer for the file created with cut command | 290 | #h play: This command runs mplayer for the file created with cut command |
| 222 | #h play: | 291 | #h play: |
| | 292 | |
| | 293 | #h move: move <directory> <destfile> |
| | 294 | #h move: |
| | 295 | #h move: Moves final output file to a new destination. |
| | 296 | #h move: |
| | 297 | |
| | 298 | #h getyuv: getyuv [<directory>|examples] |
| | 299 | #h getyuv: |
| | 300 | #h getyuv: Decodes selected mpeg2 frames as a stream of yuv4mpeg pictures. |
| | 301 | #h getyuv: useful for further encoding. |
| | 302 | #h getyuv: |
| | 303 | |
| | 304 | #h getmp2: getmp2 [<directory>|examples] |
| | 305 | #h getmp2: |
| | 306 | #h getmp2: Extracts selected mp2 audio data, to be muxed with (re-encoded) |
| | 307 | #h getmp2: video. Mp2 data can be used as is, or as encoded to mp3 or vorbis... |
| | 308 | #h getmp2: |
| | 309 | |
| | 310 | #h contrib: contrib |
| | 311 | #h contrib: |
| | 312 | #h contrib: Contribution material. Mostly encoding scripts. The command line |
| | 313 | #h contrib: interface of the programs these scripts invoke may change over |
| | 314 | #h contrib: time -- there is less quarantees that these work in future than |
| | 315 | #h contrib: other m2vmp2cut functionality, in short term period... |
| | 316 | #h contrib: |