From 321d998b5a3d2c1f3a39187f22cd4827620c39d9 Mon Sep 17 00:00:00 2001 From: aweaver Date: Sun, 16 Apr 2017 07:01:40 -0700 Subject: [PATCH] name,filter and spaces --- check_audio_framemd5.sh | 16 ++++++++-------- check_framemd5.sh => check_video_framemd5.sh | 0 index.html | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) rename check_framemd5.sh => check_video_framemd5.sh (100%) diff --git a/check_audio_framemd5.sh b/check_audio_framemd5.sh index ecae7f4..ca987a1 100755 --- a/check_audio_framemd5.sh +++ b/check_audio_framemd5.sh @@ -54,24 +54,24 @@ done echo -e "${BLUE}Please wait...${NC}" unset md5_tmp if [[ $OSTYPE = "cygwin" ]]; then - md5_tmp=""${USERPROFILE}/$(basename ${input_hash}).tmp"" + md5_tmp="${USERPROFILE}/$(basename "${input_hash}").tmp" else - md5_tmp="${HOME}/$(basename ${input_hash}).tmp" + md5_tmp="${HOME}/$(basename "${input_hash}").tmp" fi # Find audio frame size for hash calculation -sample_rate=$(grep -v '^#' ${input_hash} | head -n 1 | tr -d ' ' | cut -d',' -f4) -$(ffmpeg -i ${input_file} -loglevel 0 -filter_complex "asetnsamples=n='$sample_rate'" -f framemd5 -vn ${md5_tmp}) +sample_rate=$(grep -v '^#' "${input_hash}" | head -n 1 | tr -d ' ' | cut -d',' -f4) +ffmpeg -i "${input_file}" -loglevel 0 -af "asetnsamples=n='$sample_rate'" -f framemd5 -vn "${md5_tmp}" [[ ! -f ${md5_tmp} ]] && { echo -e "${RED}Error: '${input_file}' is not a valid audio-visual file.${NC}" ; _output_prompt ; } unset old_file unset tmp_file unset sample_rate -old_file=$(grep -v '^#' ${input_hash}) -tmp_file=$(grep -v '^#' ${md5_tmp}) +old_file=$(grep -v '^#' "${input_hash}") +tmp_file=$(grep -v '^#' "${md5_tmp}") if [[ "${old_file}" = "${tmp_file}" ]]; then - echo -e "${BLUE}'$(basename ${input_file})' matches '$(basename ${input_hash})'${NC}" + echo -e "${BLUE}'$(basename "${input_file}")' matches '$(basename "${input_hash}")'${NC}" rm "${md5_tmp}" else - echo -e "${RED}The following differences were detected between '$(basename ${input_file})' and '$(basename ${input_hash})':${NC}" + echo -e "${RED}The following differences were detected between '$(basename "${input_file}")' and '$(basename "${input_hash}")':${NC}" diff "${input_hash}" "${md5_tmp}" rm "${md5_tmp}" fi diff --git a/check_framemd5.sh b/check_video_framemd5.sh similarity index 100% rename from check_framemd5.sh rename to check_video_framemd5.sh diff --git a/index.html b/index.html index ce2f726..5631605 100644 --- a/index.html +++ b/index.html @@ -1172,7 +1172,7 @@ foreach ($file in $inputfiles) {
-an
ignores the audio stream (audio no)
output_file
path, name and extension of the output file
-

You may verify an MD5 checksum file created this way by using a Bash script.

+

You may verify an MD5 checksum file created this way by using a Bash script.

@@ -1187,7 +1187,7 @@ foreach ($file in $inputfiles) {