From a9824296cf6ccd8e34e559991c55ce397a7d26d1 Mon Sep 17 00:00:00 2001 From: tinytomato Date: Mon, 9 Nov 2020 11:53:03 -0500 Subject: [PATCH] Adds audio filter if the audio framerate is variable Corrects for if syntax error --- makederiv | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makederiv b/makederiv index 70b628c..01d0ea8 100755 --- a/makederiv +++ b/makederiv @@ -565,6 +565,11 @@ while [[ "${@}" != "" ]] ; do fi if [[ "${AUDIOSTREAMCOUNT}" -gt 0 ]] ; then _get_audio_index "${SOURCEFILE}" + AUDIO_STTS_ENTRIES=$(mediaconch -mt "${SOURCEFILE}" | xmlstarlet sel -N mt="https://mediaarea.net/mediatrace" -v -t -m "mt:MediaTrace/mt:media/mt:block[@name='File header']/mt:block[@name='Track'][mt:block[@name='Media']/mt:block[@name='Media Information']/mt:block[@name='Sound Media Header']]/mt:block[@name='Media']/mt:block[@name='Media Information']/mt:block[@name='Sample Table']/mt:block[@name='Time to Sample']" -v "mt:data[@name='Number of entries']" ) + if [[ "${AUDIO_STTS_ENTRIES}" -gt 2 ]] ; then + _add_audio_filter "aresample=async=1" + _report -d "The audio framerate is variable; adding 'aresample=async=1'" + fi if [[ "${OUTPUT_TYPE}" == "broadcast" ]] ; then MIDDLEOPTIONS+=(-acodec pcm_s24be) MIDDLEOPTIONS+=(-ar 48k)