diff options
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-x | localvideowebencode | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/localvideowebencode b/localvideowebencode index a4d08a7..e048121 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -365,30 +365,36 @@ esac [ $channels -le $maxchannels ] || channels=$maxchannels [ $channels -gt 0 ] || channels= +# generic options melt="melt -progress" +avconv="avconv -threads auto -y -v warning" _melt_sample="$infile_first ${sample:+in=${samplestart:-0} out=$((${samplestart:-0} + samplelength))}" _melt_video="progressive=1${framerate:+ frame_rate_num="$framerate_num" frame_rate_den="$framerate_den"}${size:+ s=${width:+$width}x${height:+$height}}${aspect:+ aspect=$aspect}" +_melt_audio="${channels:+ac=$channels}" + +# filter options +# limit (i.e. avoid peaks "clipping") +_melt_postfilters_audio="${limit:+-filter ladspa.1077}" + +# codec options _melt_theora="vcodec=libtheora${bitrate:+ vb=$bitrate} qscale=$qscale_theora" _melt_vp8="vcodec=libvpx vpreset=libvpx-$webmpreset${bitrate_vp8:+ vb=$bitrate_vp8 minrate=$((bitrate_vp8/20)) maxrate=$((bitrate_vp8*12))} crf=$crf_vp8 cpu-used=$cpu_vp8" +_avconv_vp8="-c:v libvpx -pre:v libvpx-$webmpreset${bitrate_vp8:+ -b:v $bitrate_vp8 -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))} -crf $crf_vp8 -cpu-used $cpu_vp8" # CRF ignored with libvpx 1.3 _melt_vp9="vcodec=libvpx-vp9 vpreset=libvpx-$webmpreset${bitrate_vp9:+ vb=$bitrate_vp9 minrate=$((bitrate_vp9/20)) maxrate=$((bitrate_vp9*12))} crf=$crf_vp9 cpu-used=$cpu_vp9" +_avconv_vp9="-c:v libvpx-vp9 -pre:v libvpx-$webmpreset${bitrate_vp9:+ -b:v $bitrate_vp9 -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))} -crf $crf_vp9 -cpu-used $cpu_vp9" _melt_h264="vcodec=libx264 vpreset=$speedpreset_h264 vprofile=baseline${x264tune:+ tune=$x264tune} threads=0 movflags=+faststart crf=$crf_h264" -_melt_audio="${channels:+ac=$channels}" -# limit (i.e. avoid peaks "clipping") -_melt_postfilters_audio="${limit:+-filter ladspa.1077}" _melt_vorbis="$_melt_audio acodec=libvorbis${channels:+ ab=$(($channels*$bitrate_vorbis))k}" _melt_opus="$_melt_audio acodec=libopus${channels:+ ab=$(($channels*$bitrate_opus))k}${opusapp:+ application=$opusapp}" _melt_aac="$_melt_audio acodec=aac${channels:+ ab=$(($channels*$bitrate_aac))k}" + +# container options _melt_ogg="f=ogg $_melt_video $_melt_theora $_melt_vorbis" _melt_webm="f=webm $_melt_video $_melt_vp8 $_melt_vorbis" _melt_webm_vp9="f=webm $_melt_video $_melt_vp9 $_melt_vorbis" _melt_mp4="f=mp4 $_melt_video $_melt_h264 $_melt_aac" _melt_img="f=image2 $_melt_video" -avconv="avconv -threads auto -y -v warning" -_avconv_vp8="-c:v libvpx -pre:v libvpx-$webmpreset${bitrate_vp8:+ -b:v $bitrate_vp8 -minrate $((bitrate_vp8/20)) -maxrate $((bitrate_vp8*12))} -crf $crf_vp8 -cpu-used $cpu_vp8" -_avconv_vp9="-c:v libvpx-vp9 -pre:v libvpx-$webmpreset${bitrate_vp9:+ -b:v $bitrate_vp9 -minrate $((bitrate_vp9/20)) -maxrate $((bitrate_vp9*12))} -crf $crf_vp9 -cpu-used $cpu_vp9" - # resolve EBU R128 audio normalizing if [ -n "$loudness" ] && [ -z "$_melt_loudness" ]; then echo "Analyzing loudness data..." |