diff options
-rwxr-xr-x | localvideowebencode | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/localvideowebencode b/localvideowebencode index 25df1d5..4cc654e 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -140,6 +140,10 @@ while true ; do esac done +# Resolve if melt is version 0.9.2 or newer +# TODO: drop when melt 0.9.2 is stable +melt_recent=$(melt -query filter=loudness | grep -i R128) + while [ $# -gt 0 ] ; do case "$1" in *=*) _melt_in="${_melt_in:+$_melt_in }$1"; shift;; @@ -279,10 +283,11 @@ $melt -group $_melt_in $infiles -group $filters -consumer avformat:"$stem.ogv" $ ## H.264/AAC/MP4 [ -z "$bitrate" ] || $melt -group $_melt_in $infiles -group $filters -consumer avformat:/dev/null properties=x264-medium-pass1 $_melt_h264 $_melt_out $melt -group $_melt_in $infiles -group $filters -consumer avformat:"$stem.mp4" ${bitrate:+pass=2} $_melt_h264 $_melt_aac $_melt_out -# TODO: drop qt-faststart when melt 0.9.2 is stable -mv "$stem.mp4" "$stem.mp4"~ -qt-faststart "$stem.mp4"~ "$stem.mp4" -[ -f "$stem.mp4" ] && rm "$stem.mp4"~ || mv -f "$stem.mp4"~ "$stem.mp4" +if [ -z "$melt_recent" ]; then + mv "$stem.mp4" "$stem.mp4"~ + qt-faststart "$stem.mp4"~ "$stem.mp4" + [ -f "$stem.mp4" ] && rm "$stem.mp4"~ || mv -f "$stem.mp4"~ "$stem.mp4" +fi ## VP8/Vorbis/WebM # TODO: use two-pass when supported by melt |