diff options
author | Jonas Smedegaard <dr@jones.dk> | 2021-02-09 03:06:01 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2021-02-09 03:06:01 +0100 |
commit | 6f28be41f75d335415bfb804b0006e664a6d30ee (patch) | |
tree | f9d30bf5e4e42976e4643e00725ab2d776f94a7b | |
parent | 0bcd710bdd37707ee92d8ed751878fb0c0183958 (diff) |
tidy: adjust whitespace
-rwxr-xr-x | localvideowebencode | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/localvideowebencode b/localvideowebencode index cbcbdc8..1d99fc2 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -743,48 +743,48 @@ if [ -n "$loudness" ] && [ -z "$silence$_melt_loudness" ]; then fi if [ -n "${webm:+$multipass_vp8}${webm_vp9:+$multipass_vp9}${mp4:+$multipass_avc}" ]; then - echo >&2 "Analyzing video complexity..." - render melt $_melt_infiles $filters $_melt_stdout \ - ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ - pass=1 passlogfile=${stem}_vp8}} \ - ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ - pass=1 passlogfile=${stem}_vp9}} \ - ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 \ - pass=1 passlogfile=${stem}_avc}} \ - | pee \ - ${any_ffmpeg:+"$(render ffmpeg-chained-echo $_ffmpeg_stdin \ + echo >&2 "Analyzing video complexity..." + render melt $_melt_infiles $filters $_melt_stdout \ + ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ + pass=1 passlogfile=${stem}_vp8}} \ + ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ + pass=1 passlogfile=${stem}_vp9}} \ + ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 \ + pass=1 passlogfile=${stem}_avc}} \ + | pee \ + ${any_ffmpeg:+"$(render ffmpeg-chained-echo $_ffmpeg_stdin \ ${webm:+${use_ffmpeg_vp8:+$_ffmpeg_rawvideo $_ffmpeg_vp8 -an \ - -pass 1 -passlogfile ${stem}_vp8 /dev/null}} \ + -pass 1 -passlogfile ${stem}_vp8 /dev/null}} \ ${webm_vp9:+${use_ffmpeg_vp9:+$_ffmpeg_rawvideo $_ffmpeg_vp9 -an \ - -pass 1 -passlogfile ${stem}_vp9 /dev/null}} \ + -pass 1 -passlogfile ${stem}_vp9 /dev/null}} \ ${mp4:+${use_ffmpeg_avc:+$_ffmpeg_rawvideo $_ffmpeg_avc -an \ - -pass 1 -passlogfile ${stem}_avc /dev/null}})"} \ - ${webm:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp8 \ + -pass 1 -passlogfile ${stem}_avc /dev/null}})"} \ + ${webm:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp8 \ --pass=1 --fpf=${stem}_vp8.log -o /dev/null)"}} \ - ${webm_vp9:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp9 \ + ${webm_vp9:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp9 \ --pass=1 --fpf=${stem}_vp9.log -o /dev/null)"}} fi - echo >&2 "Encoding video${channels:+ and audio}..." - render melt $_melt_infiles \ - ${channels:+$audioprefilters \ - ${_melt_loudness:+-filter loudness program=$lufs \ - results="$_melt_loudness"}} \ - $filters${channels:+ $_melt_postfilters_audio} \ - ${ogg:+${use_melt_theora:+-consumer avformat:$stem.ogv $_melt_ogg}} \ - ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ - ${multipass_vp8:+pass=2 passlogfile=${stem}_vp8}}} \ - ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ - ${multipass_vp9:+pass=2 passlogfile=${stem}_vp9}}} \ - ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 - ${multipass_avc:+pass=2 passlogfile=${stem}_avc}}} \ - ${channels:+${use_wav:+-consumer avformat:$stem.wav \ - $_melt_wav}} \ - ${channels:+${use_matroska:+-consumer avformat:$stem.mkv \ - $_melt_matroska_pcm}} \ - $_melt_stdout \ - | pee \ - ${any_ffmpeg:+"$(render ffmpeg-chained-echo $_ffmpeg_stdin \ +echo >&2 "Encoding video${channels:+ and audio}..." +render melt $_melt_infiles \ + ${channels:+$audioprefilters \ + ${_melt_loudness:+-filter loudness program=$lufs \ + results="$_melt_loudness"}} \ + $filters${channels:+ $_melt_postfilters_audio} \ + ${ogg:+${use_melt_theora:+-consumer avformat:$stem.ogv $_melt_ogg}} \ + ${webm:+${use_melt_vp8:+-consumer avformat:$stem.webm $_melt_webm \ + ${multipass_vp8:+pass=2 passlogfile=${stem}_vp8}}} \ + ${webm_vp9:+${use_melt_vp9:+-consumer avformat:${stem}_vp9.webm $_melt_webm_vp9 \ + ${multipass_vp9:+pass=2 passlogfile=${stem}_vp9}}} \ + ${mp4:+${use_melt_avc:+-consumer avformat:$stem.mp4 $_melt_mp4 + ${multipass_avc:+pass=2 passlogfile=${stem}_avc}}} \ + ${channels:+${use_wav:+-consumer avformat:$stem.wav \ + $_melt_wav}} \ + ${channels:+${use_matroska:+-consumer avformat:$stem.mkv \ + $_melt_matroska_pcm}} \ + $_melt_stdout \ +| pee \ + ${any_ffmpeg:+"$(render ffmpeg-chained-echo $_ffmpeg_stdin \ ${webm:+${use_ffmpeg_vp8:+$_ffmpeg_webm_onlyvideo \ ${multipass_vp8:+-pass 2 -passlogfile ${stem}_vp8} \ ${stem}${channels:+_silent}.webm}} \ @@ -794,53 +794,53 @@ fi ${mp4:+${use_ffmpeg_avc:+$_ffmpeg_mp4_onlyvideo \ ${multipass_avc:+-pass 2 -passlogfile ${stem}_avc} \ ${stem}${channels:+_silent}.mp4}})"} \ - ${webm:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp8 \ - ${multipass_vp8:+--pass=2 --fpf=${stem}_vp8.log} \ - -o ${stem}${channels:+_silent}.webm)"}} \ - ${webm_vp9:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp9 \ - ${multipass_vp9:+--pass=2 --fpf=${stem}_vp9.log} \ - -o ${stem}_vp9${channels:+_silent}.webm)"}} - if [ -n "${webm:+$use_vpxenc$use_oggenc}" ] && [ -n "$channels" ]; then - echo >&2 "Encoding Vorbis audio and muxing with VP8 video..." - if [ -n "$use_oggenc" ]; then - render oggenc $_oggenc_wav_in $_oggenc_vorbis -o - $stem.wav \ - | render ffmpeg-chained \ - $_ffmpeg_webm_in -i ${stem}_silent.webm \ - $_ffmpeg_ogg_in -i pipe:0 \ - $_ffmpeg_webm_keepvideo $stem.webm - else - render ffmpeg $_ffmpeg_webm_in -i ${stem}_silent.webm \ - $_ffmpeg_matroska_wav_in -i $stem.mkv \ - $_ffmpeg_webm_keepvideo ${stem}.webm - fi + ${webm:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp8 \ + ${multipass_vp8:+--pass=2 --fpf=${stem}_vp8.log} \ + -o ${stem}${channels:+_silent}.webm)"}} \ + ${webm_vp9:+${use_vpxenc:+"$(render vpxenc-chained-echo - $_vpxenc_vp9 \ + ${multipass_vp9:+--pass=2 --fpf=${stem}_vp9.log} \ + -o ${stem}_vp9${channels:+_silent}.webm)"}} +if [ -n "${webm:+$use_vpxenc$use_oggenc}" ] && [ -n "$channels" ]; then + echo >&2 "Encoding Vorbis audio and muxing with VP8 video..." + if [ -n "$use_oggenc" ]; then + render oggenc $_oggenc_wav_in $_oggenc_vorbis -o - $stem.wav \ + | render ffmpeg-chained \ + $_ffmpeg_webm_in -i ${stem}_silent.webm \ + $_ffmpeg_ogg_in -i pipe:0 \ + $_ffmpeg_webm_keepvideo $stem.webm + else + render ffmpeg $_ffmpeg_webm_in -i ${stem}_silent.webm \ + $_ffmpeg_matroska_wav_in -i $stem.mkv \ + $_ffmpeg_webm_keepvideo ${stem}.webm fi - if [ -n "${webm_vp9:+$use_vpxenc$use_opusenc}" ] && [ -n "$channels" ]; then - echo >&2 "Encoding Opus audio and muxing with VP9 video..." - if [ -n "$use_opusenc" ]; then - render opusenc $_opusenc_wav_in $_opusenc_opus -o - $stem.wav \ - | render ffmpeg-chained \ - $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ - $_ffmpeg_ogg_in -i pipe:0 \ - $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm - else - render ffmpeg $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ - $_ffmpeg_matroska_wav_in -i $stem.mkv \ - $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm - fi +fi +if [ -n "${webm_vp9:+$use_vpxenc$use_opusenc}" ] && [ -n "$channels" ]; then + echo >&2 "Encoding Opus audio and muxing with VP9 video..." + if [ -n "$use_opusenc" ]; then + render opusenc $_opusenc_wav_in $_opusenc_opus -o - $stem.wav \ + | render ffmpeg-chained \ + $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ + $_ffmpeg_ogg_in -i pipe:0 \ + $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm + else + render ffmpeg $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ + $_ffmpeg_matroska_wav_in -i $stem.mkv \ + $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm fi - if [ -n "${mp4:+$use_ffmpeg_avc}" ] && [ -n "$channels" ]; then - if [ -n "$use_mp3" ]; then - echo "Encoding MP3 audio and muxing with H.264/AVC video..." - render ffmpeg $_ffmpeg_mp4_in -i ${stem}_silent.mp4 \ - $_ffmpeg_matroska_wav_in -i $stem.mkv \ - $_ffmpeg_mp4_keepvideo ${stem}.mp4 - else - echo "Encoding AAC audio and muxing with H.264/AVC video..." - render ffmpeg $_ffmpeg_mp4_in -i ${stem}_silent.mp4 \ - $_ffmpeg_matroska_wav_in -i $stem.mkv \ - $_ffmpeg_mp4_keepvideo_aac ${stem}.mp4 - fi +fi +if [ -n "${mp4:+$use_ffmpeg_avc}" ] && [ -n "$channels" ]; then + if [ -n "$use_mp3" ]; then + echo "Encoding MP3 audio and muxing with H.264/AVC video..." + render ffmpeg $_ffmpeg_mp4_in -i ${stem}_silent.mp4 \ + $_ffmpeg_matroska_wav_in -i $stem.mkv \ + $_ffmpeg_mp4_keepvideo ${stem}.mp4 + else + echo "Encoding AAC audio and muxing with H.264/AVC video..." + render ffmpeg $_ffmpeg_mp4_in -i ${stem}_silent.mp4 \ + $_ffmpeg_matroska_wav_in -i $stem.mkv \ + $_ffmpeg_mp4_keepvideo_aac ${stem}.mp4 fi +fi # cleanup encoding cruft rm -f $stem.xml $stem.wav $stem.mkv ${stem}_*.log ${stem}_*silent.webm |