All pastes #913534 Raw Edit

Something

public shellscript v1 · immutable
·published 2008-02-22 03:52 UTC
rendered paste body
#!/bin/bashget_listargs(){    unset x ARGS_ARRAY    # Hackish list-parsing    while test $# -gt 0 && test x"${1:0:1}" != x"-"; do        ARGS_ARRAY[x++]="$1"        shift    done    # Do not skip past the next argument    if test $# -gt 0 && test x"${1:0:1}" = x"-";then        DO_SHIFT=false    fi}yuvstrip (){       read junk       cat       return 0}while test $# -gt 0; do    DO_SHIFT=:    case "$1" in        "-files")            shift            get_listargs "$@"            for f in  ${!ARGS_ARRAY[@]}; do                INFILES[f]=$(readlink -f "${ARGS_ARRAY[f]}")            done             ;;        "-audio" )            shift            AUDIO=$(readlink -f "$1")            ;;        "-out" )            shift            OUTFILE=$(readlink -f "$1")            ;;    esac    $DO_SHIFT && shiftdonemkfifo enc.fifoIMGENC_CMD=(ffmpeg -f yuv4mpegpipe -i - -i "$AUDIO" -shortest -acodec ac3 -ab 224k -ar 48000 -target ntsc-dvd -y "$OUTFILE")"${IMGENC_CMD[@]}" 2>/dev/null < enc.fifo &exec 3> enc.fifofor i in ${!INFILES[@]}; do    ((i==0)) && strip="cat" || strip="yuvstrip"    ffmpeg -i "${INFILES[i]}" -an -f yuv4mpegpipe - | $stripdone >&3