diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-09-20 13:46:58 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-09-20 13:46:58 +0200 |
commit | d6426cf3b00b3066e4438d0c72dd1c4baace3301 (patch) | |
tree | 48be9c1fbf16d57a660c795af9a1910c54548325 | |
parent | 4e17942870bbb662a404b5ebe5b6c6e0b9470059 (diff) |
Separate sample input options from resulting melt-specific arguments.
-rwxr-xr-x | localvideowebencode | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/localvideowebencode b/localvideowebencode index c03d848..b99fdd7 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -79,8 +79,8 @@ html favoring open formats with optional non-JavaScript Flash fallback. -t, --title Title used in html fallback graphics (default: stem) --filter Add melt filter (applied to all input files) - --sample[=frame] Limit output to a 150 frames sample from - beginning or optionally a later start frame + --sample [start] Create only a 150 frames long sample from + beginning or optionally a later start frame. -h, --help This help text Examples: @@ -114,6 +114,7 @@ exit1() { # defaults h264profile=baseline +samplelength=150 # parse cmdline options TEMP="`getopt -s sh -o hp:s:a:r:b:t: -l help,profile:,size:,aspect:,rate:,video:,refbpp:,bitrate:,h264profile:,h264preset:,webmpreset:,audio:,stem:,title:,filter:,sample:: -n "$PRG" -- "$@"`" || exit1 "Internal getopt error." @@ -142,7 +143,7 @@ while true ; do esac done ;; - --sample) sample="in=${2:-0} out=$((${2:-0} + 150))"; shift 2;; + --sample) sample=yes; samplestart="${2:-0}"; shift 2;; --) shift; break;; *) exit1 "Internal error resolving options.";; esac @@ -327,7 +328,7 @@ esac # TODO: When verified beneficial, add option real_time=-2 melt="melt -progress" -_melt_in="${_melt_in:+$_melt_in }$sample" +_melt_in="${_melt_in:+$_melt_in }${sample:+in=${samplestart:-0} out=$((${samplestart:-0} + samplelength))}" _melt_video="progressive=1${framerate:+ frame_rate_den="$framerate_den" frame_rate_num="$framerate_num"}${bitrate:+ vb=$bitrate}${size:+ s=${width:+$width}x${height:+$height}}${aspect:+ aspect=$aspect}" _melt_ogg="$_melt_video f=ogg vcodec=libtheora${bitrate_fixed:- qscale=5}" _melt_h264="$_melt_video $_melt_h264${bitrate_fixed:- qscale=5}" |