name,filter and spaces

This commit is contained in:
aweaver 2017-04-16 07:01:40 -07:00
parent d3a941a725
commit 321d998b5a
3 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -1172,7 +1172,7 @@ foreach ($file in $inputfiles) {
<dt>-an</dt><dd>ignores the audio stream (audio no)</dd>
<dt><i>output_file</i></dt><dd>path, name and extension of the output file</dd>
</dl>
<p>You may verify an MD5 checksum file created this way by using a <a href="check_framemd5.sh" target="_blank">Bash script</a>.</p>
<p>You may verify an MD5 checksum file created this way by using a <a href="check_video_framemd5.sh" target="_blank">Bash script</a>.</p>
<p class="link"></p>
</div>
</div>
@ -1187,7 +1187,7 @@ foreach ($file in $inputfiles) {
<div class="modal-content">
<div class="well">
<h3>Create MD5 checksums (audio samples)</h3>
<p><code>ffmpeg -i <i>input_file</i> -filter_complex "asetnsamples=<i>n=48000</i>" -f framemd5 -vn <i>output_file</i></code></p>
<p><code>ffmpeg -i <i>input_file</i> -af "asetnsamples=<i>n=48000</i>" -f framemd5 -vn <i>output_file</i></code></p>
<p>This will create an MD5 checksum for each group of 48000 audio samples.<br> The number of samples per group can be set arbitrarily, but it's good practice to match the samplerate of the media file (so you will get one checksum per second).</p>
<p>Examples for other samplerates:</p>
<ul>