summaryrefslogtreecommitdiff
path: root/localvideowebencode
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2021-01-30 15:57:03 +0100
committerJonas Smedegaard <dr@jones.dk>2021-02-03 16:56:33 +0100
commit33512e3ce2165944311cbd8af20b9c9baa752927 (patch)
treeef28c76736cb1d1deb054a0e571ce2445fc8014f /localvideowebencode
parentc8608128ba9222f27b69937e60d0a72290a28dfb (diff)
single-pass encode vp8/vp9 streams with melt, and dual-pass encode with ffmeg (not vpxenc, but also not always melt: supports only h264 in dual-pass)
Diffstat (limited to 'localvideowebencode')
-rwxr-xr-xlocalvideowebencode18
1 files changed, 11 insertions, 7 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 08dddd7..f16587d 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -202,19 +202,12 @@ infile_first=$(perl -e 'print shift @ARGV' $infiles)
stem=${stem:-$(basename "$infile_first" | perl -pe 's/\.[^.]*//')}
title=${title:-$stem}
-# Avoid melt for VP8 and VP9: multipass broken for these codecs
#use_ffmpeg_vp8=yes
#use_ffmpeg_vp9=yes
#use_vpxenc=yes
# Avoid discrete audio encoders if possible: may cause sync problems
#use_oggenc=yes
#use_opusenc=yes
-if [ -n "$use_ffmpeg_vp8$use_ffmpeg_vp9$use_vpxenc" ]; then
- [ -n "$use_oggenc" ] || use_ffmpeg_ogg=yes
- [ -n "$use_opusenc" ] || use_ffmpeg_opus=yes
- [ -z "$use_oggenc$use_opusenc" ] || use_wav=yes
- [ -z "$use_ffmpeg_ogg$use_ffmpeg_opus" ] || use_matroska=yes
-fi
# Avoid AAC: Lame arguably better than any free AAC encoder
# Argument for AAC: Safari possibly lacks mp3 support in video container
#use_mp3=yes
@@ -449,6 +442,17 @@ if [ -n "$stereo$mono" ]; then
fi
fi
+for vformat in vp8 vp9 h264; do
+ # melt supports dual-pass mode only for h.264
+ [ h264 = "$vformat" ] || [ -n "$vpxenc" ] || [ -z "$multipass" ] || eval "use_ffmpeg_$vformat=yes"
+done
+if [ -n "$use_ffmpeg_vp8$use_ffmpeg_vp9$use_vpxenc" ]; then
+ [ -n "$use_oggenc" ] || use_ffmpeg_ogg=yes
+ [ -n "$use_opusenc" ] || use_ffmpeg_opus=yes
+ [ -z "$use_oggenc$use_opusenc" ] || use_wav=yes
+ [ -z "$use_ffmpeg_ogg$use_ffmpeg_opus" ] || use_matroska=yes
+fi
+
# generic options
melt="melt -progress"
which ffmpeg > /dev/null && ffmpeg=ffmpeg || ffmpeg=avconv