From e9a70c4ff3dfeca079e6f5ff6e1ff4dc8a2f028a Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 18 Aug 2023 14:17:45 +0000 Subject: [PATCH] Build/synOTR.sh aktualisiert --- Build/synOTR.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Build/synOTR.sh b/Build/synOTR.sh index 5247c45..83933b6 100644 --- a/Build/synOTR.sh +++ b/Build/synOTR.sh @@ -122,14 +122,17 @@ synOTR_PATH=$PATH:${APPDIR}/app/bin bsy="${APPDIR}/app/bin/busybox" # ffmpeg="${APPDIR}/app/bin/ffmpeg" - ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt + # ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt + ffmpeg="/usr/local/bin/ffmpeg6" # ffmpeg 6 von synocommunity avcut="${APPDIR}/app/bin/avcut64" ionice="${APPDIR}/app/bin/ionice64" elif [ `echo $machinetyp | grep "armv7" ` ] ; then synOTR_LD_LIBRARY_PATH=${APPDIR}/app/libARMv7l:$LD_LIBRARY_PATH synOTR_PATH=$PATH:${APPDIR}/app/binARMv7l:/opt/bin bsy="${APPDIR}/app/binARMv7l/busybox" - ffmpeg="${APPDIR}/app/binARMv7l/ffmpeg" + # ffmpeg="${APPDIR}/app/binARMv7l/ffmpeg" + # ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt + ffmpeg="/usr/local/bin/ffmpeg6" # ffmpeg 6 von synocommunity avcut="${APPDIR}/app/binARMv7l/avcut" if [[ `uname -a | grep "armadaxp" ` ]] ; then echo " alternative avcut-Version ohne asm wird verwendet" @@ -139,7 +142,8 @@ elif [ $machinetyp = "i686" ] ; then bsy="${APPDIR}/app/bin/busybox" # ffmpeg="${APPDIR}/app/bin/ffmpeg" - ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt + # ffmpeg=`which ffmpeg` # mitgeliefertes ffmpeg läuft derzeit nicht korrekt + ffmpeg="/usr/local/bin/ffmpeg6" # ffmpeg 6 von synocommunity avcut="${APPDIR}/app/bin/avcut32" synOTR_LD_LIBRARY_PATH=$SAVED_LD_LIBRARY_PATH synOTR_PATH=$PATH:${APPDIR}/app/bin @@ -329,7 +333,7 @@ sec_to_time() MovieDB_query() { ######################################################################################### -# Diese Funktion sucht auf MovieDB.com nach Filminformationen # +# Diese Funktion sucht auf theTVDB.com nach Serieninformationen # ######################################################################################### echo -e @@ -1868,9 +1872,10 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then echo -n " "; date; echo -e title=${title%.*} - fileinfo=$($ffmpeg -i "$i" 2>&1) - ffprobeInfo=$(ffprobe -v quiet -print_format json -show_format -show_streams "$i" 2>&1) +# fileinfo=$($ffmpeg -i "$i" 2>&1) +# fileinfo=$($ffmpeg -i "$i" -f null - 2>&1) + ffprobeInfo=$(ffprobe -v quiet -print_format json -show_format -show_streams "$i" 2>&1) # Errormeldung vor jason ab DSM 6.2 (wird hier abgeschnitten): ERROR: # ld.so: object 'openhook.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. { … ffprobeInfo="{ ${ffprobeInfo#*\{}" @@ -1899,7 +1904,8 @@ if [ $OTRavi2mp4active = "on" ] && [ ! -z "$filetest" ] ; then echo "Audiocodec: $audiocodec" # ------- VIDEOCODEC: - videocodec=`echo "$fileinfo" | grep "Video:" | $bsy awk '{print $4}'` + videocodec=$(echo "${ffprobeInfo}" | jq -r '.streams[0].codec_tag_string' | tr '[:upper:]' '[:lower:]' ) # | sed "s/\"//g" + if [ $videocodec = "mpeg4" ] ; then videocodec="divx" vExt="tmp.m4v"; @@ -2121,7 +2127,6 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4" echo "Fileextension: $fileextension" # ------------------ technische Filmdaten via ffmpeg und ffprobe auslesen: - fileinfo=$(ffmpeg -i "$i" 2>&1) ffprobeInfo=$(ffprobe -v quiet -print_format json -show_format -show_streams "$i" 2>&1) # Errormeldung vor jason ab DSM 6.2 (wird hier abgeschnitten): ERROR: @@ -2129,7 +2134,6 @@ for i in $(find "$WORKDIR" -maxdepth 1 -name "*TVOON*avi" -o -name "*TVOON*mp4" ffprobeInfo="{ ${ffprobeInfo#*\{}" if [ $LOGlevel = "2" ] ; then - echo "Dateiinformation von ffmpeg ausgelesen:"; echo "$fileinfo"; echo -e echo "Dateiinformation von ffprobe ausgelesen:"; echo "$ffprobeInfo"; echo -e fi @@ -2923,7 +2927,7 @@ for i in $(ls -tr "${logdir}" | egrep -o '^synOTR.*.log$') # A done # überzählige Logs löschen: -count2del=$( expr $( ls -t "${logdir}" | egrep -o '^synOTR.*.log$' | wc -l ) - $LOGmax ) # wie viele Dateien sind überzählig +count2del=$(( $( ls -t "${logdir}" | egrep -o '^synOTR.*.log$' | wc -l ) - $LOGmax )) # wie viele Dateien sind überzählig if [ $count2del -ge 0 ]; then for i in `ls -tr "${logdir}" | egrep -o '^synOTR.*.log$' | head -n${count2del} ` do @@ -2936,7 +2940,7 @@ if [ $count2del -ge 0 ]; then fi # überzählige searches löschen: -count2del=$( expr $(ls -t "${logdir}" | egrep -o '^search.*.xml$' | wc -l) - $LOGmax ) +count2del=$(($(ls -t "${logdir}" | egrep -o '^search.*.xml$' | wc -l) - $LOGmax )) if [ ${count2del} -ge 0 ]; then for i in `ls -tr "${logdir}" | egrep -o '^search.*.xml$' | head -n${count2del} ` do @@ -2949,7 +2953,7 @@ if [ ${count2del} -ge 0 ]; then fi # überzählige cutlists löschen: -count2del=$( expr $(ls -t "${logdir}" | egrep -o '.*.cutlist$' | wc -l) - $LOGmax ) +count2del=$(($(ls -t "${logdir}" | egrep -o '.*.cutlist$' | wc -l) - $LOGmax )) if [ ${count2del} -ge 0 ]; then for i in `ls -tr "${logdir}" | egrep -o '.*.cutlist$' | head -n${count2del} ` do @@ -2988,6 +2992,6 @@ fi echo " -----------------------------------" echo " | ==> synOTR ENDE <== |" echo " -----------------------------------" - echo -e; echo " Gesamtzeit: $(sec_to_time $(expr $(date +%s)-${UNIXTIME}) )" + echo -e; echo " Gesamtzeit: $(sec_to_time $(( $(date +%s)-${UNIXTIME})))" exit