X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/blobdiff_plain/849106f7246e47bc077d7f3b8228cec717a8e63d..26f0533782d8c57fb95b8df4f55057edcbf17703:/unitproc/bktemp-check_parsable_audio_ffprobe diff --git a/unitproc/bktemp-check_parsable_audio_ffprobe b/unitproc/bktemp-check_parsable_audio_ffprobe deleted file mode 100644 index 9230a3f..0000000 --- a/unitproc/bktemp-check_parsable_audio_ffprobe +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -check_parsable_audio_ffprobe() { - # Desc: Checks if ffprobe returns valid audio codec name for file - # Usage: check_parsable_audio_ffprobe [path FILE] - # Version: 0.0.1 - # Input: arg1: file path - # Output: exit code 0 if returns valid codec name; 1 otherwise - # Depends: ffprobe, die() - local file_in ffprobe_out - - if [[ $# -ne 1 ]]; then die "ERROR:Invalid number of args:$#"; fi; - - file_in="$1"; - - # Check if ffprobe detects an audio stream - if ffprobe -v error -select_streams a -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 "$file_in" 1>/dev/null 2>&1; then - return_state="true"; - else - return_state="false"; - fi; - - # Fail if ffprobe returns no result - ffprobe_out="$(ffprobe -v error -select_streams a -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 "$file_in")"; - if [[ -z $ffprobe_out ]]; then - return_state="false"; - fi; - - # Report exit code - if [[ $return_state = "true" ]]; then - return 0; - else - return 1; - fi; -} # Checks if file has valid codec name using ffprobe - -# Author: Steven Baltakatei Sandoval -# License: GPLv3+