encode2mpeglight

来自「君正早期ucos系统(只有早期的才不没有打包成库),MPLAYER,文件系统,图」· 代码 · 共 1,545 行 · 第 1/5 页

TXT
1,545
字号
        -l|-longhelp)            #-print this help page            [[ $2 = doc || $2 = help ]] && isarg $1 $2             usage            exit            ;;        -doc|-documentation) #[[<browser>:][<html page>]]            #-show the html documentation            [[ $2 = doc || $2 = help ]] && isarg $1 $2             [[ ${2%:*} != $2 ]] && BROWSER=${2%:*}            show_html ${2#*:}            exit            ;;        -noshowlog)            #-do not show the log file            [[ $2 = doc || $2 = help ]] && isarg $1 $2             quiet=1            ;;        -o|-output) #<filename>            #-filename of the output stream            echo "$2" | grep -q '/' && [[ ! -d ${2%/*} ]] && echo "**ERROR: [$PROGNAME] directory ${2%/*} argument of '$1' not found" && exit 1            output=$2            shift            ;;        -a) #<n>            # aspect ratio     VCD SVCD  DVD            #     1 -    1:1    x    *    x	x = mpeg2enc and mencoder            #     2 -    4:3    x    x    x	* = mencoder only            #     3 -   16:9    x    x    x            #-    4 -  2.21:1        *    x            MPEG2ENCOPT="$MPEG2ENCOPT -a $2"            [[ $2 -eq 0 ]] && MPEG2ENCOPT="${MPEG2ENCOPT% ${2}} 1"            mpegaspect=$2            isarg $1 "$2" direct            shift            ;;        -mpegfixaspect) #[pad|crop]            # force the aspect ratio of the source video to match the one            # specified with -a; this can be done padding the video with            #-black lines or cropping the video; the default is padding            [[ $2 = doc || $2 = help ]] && isarg $1 $2 aspect            mpegfixaspect=0            if [[ $2 = pad || $2 = crop ]]; then                [[ $2 = crop ]] && mpegfixaspect=1                shift            fi            ;;        -rotate) #<0-3>            # rotate the source video by 90 degrees; set -mpegfixaspect;            # 0 rotate clockwise and flip, 1 rotate clockwise            #-2 rotate counterclockwise, 3 rotate counterclockwise and flip            rotate=1            echo "$2" | grep -q '^[0-3]$' && rotate=$2            isarg $1 "$2" aspect            shift            : ${mpegfixaspect:=0}            ;;        -overscan) #<n>            # shrink the video of n% and surround it with black borders,            # n can be 1-99, using 10 should make visible on a TV the full video            # image; if n is negative, the result is a magnification of the             # central part of the image; n>0 set -mpegfixaspect pad, n<0 set            #--mpegfixaspect crop; in Avi Mode n can only be positive            echo "$2" | grep -qE '^-?[0-9]?[0-9]$' && overscan=$2            [[ ${2:0:1} = - ]] && mpegfixaspect=1 || mpegfixaspect=0            isarg $1 "${2#-}" $( ((step==1)) && echo Avi || echo aspect)            shift            ;;        -abr) #<n>            #-audio bit rate of the VCD/SVCD/DVD [MP2:224,MP3:128,AC3:448]            if [[ $2 = list ]]; then                sed '/^check_abr/,/case/!d;/'"$audioformat"':/!d;/[^0-9]'"$asr"'/!d;s/[^)]*)//;s/  */ /g;s/^/'"$audioformat $asr"'/' "$PROGFILE"                exit            fi            abr=$2            isarg $1 "$2" direct            shift            ;;        -asr) #<n>            #-audio sample rate of the VCD/SVCD/DVD [MP2/MP3:44100,AC3:48000]            asr=$2            isarg $1 "$2" direct            shift            ;;        -vbr) #<n>            #-video bit rate of the VCD/SVCD/DVD [VCD:1152,SVCD:2500,DVD:7500]            vbr=$2            isarg $1 "$2" direct            shift            ;;        -vfr) #<n>            # video frame rate of the output stream            # [NTSC/VCD:4,NTSC/SVCD-DVD:1,PAL:3,AVI:2]            #     1 - 24000.0/1001.0 (NTSC 3:2 pulldown converted FILM)             #     2 - 24.0 (NATIVE FILM)             #     3 - 25.0 (PAL/SECAM VIDEO / converted FILM)             #     4 - 30000.0/1001.0 (NTSC VIDEO)             #     5 - 30.0            #     6 - 50.0 (PAL FIELD RATE)             #     7 - 60000.0/1001.0 (NTSC FIELD RATE)             #-    8 - 60.0            vfr=$2            isarg $1 "$2" direct            shift            ;;        -n|-video-norm) #<n|p|s>            # set the video norm of the VCD/SVCD/DVD; NTSC is USA standard,            # PAL is European standard and SECAM is French standard; concerning            #-VCD/SVCD/DVD encoding, SECAM is equivalent to PAL            case $2 in                n|N|ntsc|NTSC)   videonorm=n ;;                p|P|pal|PAL)     videonorm=p ;;                s|S|secam|SECAM) videonorm=s ;;                doc|help) isarg $1 $2 direct ;;                *) echo "**ERROR: [$PROGNAME] invalid argument '$2' for option '$1'" ; "$PROGFILE" -norc $1 help ; exit 1 ;;            esac            shift            ;;        -p|-pulldown|-telecine) #            # set a flag in the output stream of the SVCD/DVD that tell the            # decoder to play the movie as NTSC video using "3:2 pull-down"            #-instead of "-vfr 4" use "-vfr 1 -p" (smaller output stream)             [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            telecine=1            ;;        -res) #<1-7>            # force one of the following video resolutios:            #                      PAL            NTSC            #		1	352x288		352x240 (VCD)             #		2	352x576		352x480 (CVD)             #		3	480x576		480x480 (SVCD)             #		4	528x576		528x480 (KVCD)             #		5	544x576		544x480 (KVCD)             #		6	704x576		704x480 (DVB)             #-		7	720x576		720x480 (DVD)             isarg $1 "$2" direct            echo "$2" | grep -q '^[1-7]$' && MPGRES=$2            shift            ;;        -gop) #<n>            # set the number of pictures per GOP; the default value is the one            #-required by the standard             isarg $1 "$2" direct            GOP=$2            shift            ;;        -kvcd) #<1-4>            # generate KVCD (www.kvcd.net) compliant frames on output; the            # following resolutions are possible:            #		  PAL		  NTSC		GOP            #	1	528x576		528x480		24            #	2	528x576		528x480		def            #	3	544x576		544x480		24            #-	4	544x576		544x480		def            isarg $1 "$2" direct            a=1            echo "$2" | grep -q '^[1-4]$' && a=$2            shift 2            set -- " " -qmatrix kvcd -res $((3+(a+1)/2)) $([[ $a == [13] ]] && echo "-gop 24") "$@"            ;;        -vcd) #            #-generate VCD compliant frames on output (default)             [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            frameformat=VCD            ;;        -svcd) #[1-2]            # generate SVCD compliant frames on output; the following resolutions            # are possible:        PAL            NTSC            #		1	480x576		480x480            #		2	352x288		352x240            #-default is 1            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            frameformat=SVCD            frameres=1            echo "$2" | grep -q '^[1-2]$' && frameres=$2 && shift            ;;        -svcdht) #            # enable the VCD header trick; this trick could allow to play SVCD on            # DVD player that does not support SVCD. For more details see:            #-http://www.videohelp.com/svcd            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            trick=1            ;;        -dvd) #[1-5]            # generate DVD compliant frames on output; the following resolutions            # are possible:        PAL            NTSC            #		1	720x576		720x480            #		2	704x576		704x480            #		3	480x576		480x480 (non standard DVD-SVCD)             #		4	352x576		352x480            #		5	352x288		352x240            #-default is 1            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            frameformat=DVD            frameres=1            echo "$2" | grep -q '^[1-5]$' && frameres=$2 && shift            ;;        -vcodec) #<mpeg1|mpeg2|mpeg4>            #-force the selected video codec [VCD:mpeg1,SVCD-DVD:mpeg2,AVI:mpeg4]            isarg $1 "$2" Avi            [[ $2 == mpeg[124] ]] && vcodec=$2 && [[ ${vcodec:4:1} == [12] ]] && vcodec=${vcodec}video            shift            ;;        -qmatrix) #<kvcd|tmpgenc|default|hi-res>            # mpeg2enc custom quantization matrices: kvcd produce a smaller            #-output stream, hi-res is good for hi-quality source material            case $2 in                kvcd|tmpgenc|default|hi-res)                    MPEG2ENCOPT="$MPEG2ENCOPT -K $2"                    intra_matrix=$(eval echo \$${2/-}_intra)                    inter_matrix=$(eval echo \$${2/-}_inter)                    ;;                *)                    MPEG2ENCOPT="$MPEG2ENCOPT -K default"                    intra_matrix=                    inter_matrix=                    ;;            esac            isarg $1 "$2" direct            shift            ;;        -mpeg1vbr) #            # produce a VCD/MPEG-1 variable bit rate stream, the output stream            # is smaller and a complete movie could fit in one VCD; check if            #-your hardware player support variable bit rate VCD            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            MPEG2ENCOPT="$MPEG2ENCOPT -q 8"            LAVC=":vrc_buf_size=327"            ;;        -mpegmbr) #<n>            # set the maximum video bit rate; the default is the value of vbr;            #-a value of 0 remove the limit            mpegmbr=$2            [[ $2 -eq 0 ]] && mpegmbr=            isarg $1 "$2" mpeg            shift            ;;        -mpegchannels) #<1-6>            # number of channels of the MPEG audio stream, 1-6 for ac3 and lpcm;            # 1-2 for mp1, mp2 and mp3; 3-6 for mp2 Multichannel Audio; for the            #-avi audio stream use MPlayer's option -channels            mpegchannels=2            isarg $1 "$2" direct            echo "$2" | grep -q '^[1-6]$' && mpegchannels=$2            shift            ;;        -normalize)            #-normalize to the audio stream(s)             [[ $2 = doc || $2 = help ]] && isarg $1 $2 $([[ $encode ]] && echo Avi || echo direct)            normalize=1            ;;        -volume) #<n>            # change amplitude of the audio stream; less than 1.0 decreases,            #-greater than 1.0 increases (float)             volume=$2            isarg $1 "$2" direct            shift            ;;        -noscale) #            # encode2mpeg automatically scales the video according to the MPEG            # profile chosen, this option disables this feature; used mainly            # for debug purposes.            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            scale=            ;;        -monochrome)            #-create B/W video or avoid color artifacts in B/W source streams            [[ $2 = doc || $2 = help ]] && isarg $1 $2 direct            YUVSCALEROPT="$YUVSCALEROPT -O MONOCHROME"            ;;        -split) #<n>            #-split the resulting MPEG stream in <n> MB chunks.            split=$2            isarg $1 "$2" direct            shift            ;;        -encode) #<n:m:i[,b]>             # the parameter n:m:i selects the audio codec, video codec options            # and number of pass for mencoder, possible values are:            #   n                   m				i            #   0 copy              0 copy			1             #   1 pcm               1 libavcodec/mpeg		2            #   2 mp3lame/fast      2 as 1 + mbd=2		3            #   3 mp3lame/standard  3 as 1 + compression opts            #   4 libavcodec/mp2    4 as 1 + quality opts            #   5 libavcodec/mp3            #   6 libavcodec/ac3    for m=[2-4] and i>1 turbo is on            #   7 toolame/mp2            #   8 libfaac/aac            #-  with n=[3-7] b specify the audio bit rate            encode=5:3:2            echo "$2" | grep -qE '^[0-8]:[0-4]:[1-9](,[0-9]+)?$' && encode=$2            isarg $1 "$2" $([[ $mpeg ]] && echo mpeg || echo Avi)            shift            ;;        -telecinesrc) #            # if you use -encode n:0:i in MPEG Mode, encode2mpeg needs to know            # if the source NTSC MPEG is telecined, otherwise the stream copy may            # not work properly; normally encode2mpeg is able to detect telecined            # sources, but, if the source MPEG is mixed, part not telecined and            # part telecined, encode2mpeg may fail to detect it. In such case,            #-you can use this option to specify a telecined source.            [[ $2 = doc || $2 = help ]] && isarg $1 $2 mpeg            telesrc=1            ;;        -turbo) #<0-1>            # disable (0) or force (1) turbo mode for the first pass of N pass            #-encoding (N>1)             echo "$2" | grep -q '^[0-1]$' && turbo=$2

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?