diff options
author | Jonas Smedegaard <dr@jones.dk> | 2016-04-12 01:37:24 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2016-04-12 01:38:14 +0200 |
commit | bc3daf34ec6fe35dc816d8b7b630baaaf3e6e9ab (patch) | |
tree | b45d6461fa3e2ccb707c838d61f5ef9b12eb3b85 | |
parent | 9cb754db72f188343c9d88d6cc0ba0265d9f6c48 (diff) |
Add avconv/avprobe as fallback for ffmpeg/ffprobe.
-rwxr-xr-x | localvideowebencode | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/localvideowebencode b/localvideowebencode index 470b549..d452aab 100755 --- a/localvideowebencode +++ b/localvideowebencode @@ -385,7 +385,8 @@ case "$audio" in ;; *) exit1 "Unknown audio style \"$audio\".";; esac -channels=$(ffprobe -v warning -show_streams "$infile_first" \ +which ffprobe > /dev/null && ffprobe=ffprobe || ffprobe=avprobe +channels=$($ffprobe -v warning -show_streams "$infile_first" \ | perl -ne 's/channels=// and print $_' || echo -1) # adapt channel count and flags to reflect actual downmix/silence need if [ -n "$stereo" ]; then @@ -424,8 +425,9 @@ fi # generic options melt="melt -progress" -ffmpeg="ffmpeg -threads auto -y -v info -stats" -ffmpeg_chained="ffmpeg -threads auto -y -v warning" +which ffmpeg > /dev/null && ffmpeg=ffmpeg || ffmpeg=avconv +ffmpeg_alone="$ffmpeg -threads auto -y -v info -stats" +ffmpeg_chained="$ffmpeg -threads auto -y -v warning" vpxenc_chained="vpxenc --quiet ${processors:+-t $((processors-1))}" oggenc="oggenc" opusenc="opusenc" @@ -565,7 +567,7 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then $_ffmpeg_ogg_in -i pipe:0 \ $_ffmpeg_webm_keepvideo $stem.webm else - $ffmpeg $_ffmpeg_webm_in -i ${stem}_silent.webm \ + $ffmpeg_alone $_ffmpeg_webm_in -i ${stem}_silent.webm \ $_ffmpeg_matroska_wav_in -i $stem.mkv \ $_ffmpeg_webm_keepvideo ${stem}.webm fi @@ -579,7 +581,7 @@ if [ -n "$use_oggenc$use_opusenc$use_vpxenc" ] && [ -n "$webm$vp9" ]; then $_ffmpeg_ogg_in -i pipe:0 \ $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm else - $ffmpeg $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ + $ffmpeg_alone $_ffmpeg_webm_in -i ${stem}_vp9_silent.webm \ $_ffmpeg_matroska_wav_in -i $stem.mkv \ $_ffmpeg_webm_keepvideo_opus ${stem}_vp9.webm fi |