summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlocalvideowebencode19
1 files changed, 15 insertions, 4 deletions
diff --git a/localvideowebencode b/localvideowebencode
index 8afe6df..ae20f01 100755
--- a/localvideowebencode
+++ b/localvideowebencode
@@ -190,6 +190,12 @@ title=${title:-$stem}
use_vpxenc=yes
#use_oggenc=yes
#use_opusenc=yes
+if [ -n "$use_avconv_vp8$use_avconv_vp9$use_vpxenc" ]; then
+ [ -n "$use_oggenc" ] || use_avconv_ogg=yes
+ [ -n "$use_opusenc" ] || use_avconv_opus=yes
+ [ -z "$use_oggenc$use_opusenc" ] || use_wav=yes
+ [ -z "$use_avconv_ogg$use_avconv_opus" ] || use_matroska=yes
+fi
# resolve quality/speed hints
multipass=yes
@@ -468,6 +474,8 @@ _melt_wav="f=wav $_melt_pcm vn=1 video_off=1"
_avconv_wav_in="-f wav"
_oggenc_wav_in=
_opusenc_wav_in=
+_melt_matroska_pcm="f=matroska $_melt_downmix $_melt_pcm vn=1 video_off=1"
+_avconv_matroska_pcm_in="-f matroska"
_melt_ogg="f=ogg $_melt_video $_melt_theora ${silence:+an=1 audio_off=1}${channels:+$_melt_vorbis}"
_avconv_ogg_in="-f ogg"
_avconv_ogg_vorbis="-f ogg -vn $_avconv_vorbis"
@@ -527,7 +535,10 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then
$filters${channels:+ $_melt_postfilters_audio} \
${ogg:+-consumer avformat:$stem.ogv $_melt_ogg} \
${mp4:+-consumer avformat:$stem.mp4 $_melt_mp4} \
- ${channels:+-consumer avformat:$stem.wav $_melt_wav} \
+ ${channels:+${use_wav:+-consumer avformat:$stem.wav \
+ $_melt_wav}} \
+ ${channels:+${use_matroska:+-consumer avformat:$stem.mkv \
+ $_melt_matroska_pcm}} \
-consumer avformat:pipe:1 $_melt_yuv4mpeg2 \
| pee \
${webm:+${use_avconv_vp8:+"$avconv_chained \
@@ -558,7 +569,7 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then
$_avconv_webm_keepvideo $stem.webm
else
$avconv $_avconv_webm_in -i ${stem}_silent.webm \
- $_avconv_wav_in -i $stem.wav \
+ $_avconv_matroska_wav_in -i $stem.mkv \
$_avconv_webm_keepvideo ${stem}.webm
fi
fi
@@ -572,7 +583,7 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then
$_avconv_webm_keepvideo_opus ${stem}_vp9.webm
else
$avconv $_avconv_webm_in -i ${stem}_vp9_silent.webm \
- $_avconv_wav_in -i $stem.wav \
+ $_avconv_matroska_wav_in -i $stem.mkv \
$_avconv_webm_keepvideo_opus ${stem}_vp9.webm
fi
fi
@@ -620,7 +631,7 @@ if [ -n "$mp4" ] && [ -z "$melt_recent" ]; then
fi
# cleanup encoding cruft
-rm -f $stem.xml $stem.wav ${stem}_*.log ${stem}_*silent.webm
+rm -f $stem.xml $stem.wav $stem.mkv ${stem}_*.log ${stem}_*silent.webm
# JPEG preview
$melt $infile_first in=0 out=0 \