Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 169
View file
ffhevc.changes
Changed
@@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Sat Oct 26 07:05:00 UTC 2019 - neutrino8@opensuse.org + +- Update to version 3.9.9 +* Renamed audio variable aidi to aidxi and moved it outside + of the if conditional that decides the audio codec. This + removes the same code in three places and now uses the + global aidxi variable +* HE-AACv2 only supports 2 channels. Update the audio code + to reflect that +* When running in batch mode, add a warning about automatic + audio metadata and offer an option to enable/disable it +* Added -tmp option to MP4Box to store temp files in the + output directory +* Some minor improvements to the audio options + +------------------------------------------------------------------- Fri Oct 25 05:31:00 UTC 2019 - neutrino8@opensuse.org - Update to version 3.9.8
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 3.9.8 +Version: 3.9.9 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with FFmpeg License: GPL-2.0+
View file
ffhevc-3.9.8.tar.gz/ChangeLog -> ffhevc-3.9.9.tar.gz/ChangeLog
Changed
@@ -1,3 +1,16 @@ +2019-10-26 - ffhevc 3.9.9 + * Renamed audio variable aidi to aidxi and moved it outside + of the if conditional that decides the audio codec. This + removes the same code in three places and now uses the + global aidxi variable + * HE-AACv2 only supports 2 channels. Update the audio code + to reflect that + * When running in batch mode, add a warning about automatic + audio metadata and offer an option to enable/disable it + * Added -tmp option to MP4Box to store temp files in the + output directory + * Some minor improvements to the audio options + 2019-10-25 - ffhevc 3.9.8 * Removed M4V from the case statements for cover art. I confused it with ffx264 which supports M4V while
View file
ffhevc-3.9.8.tar.gz/ffhevc -> ffhevc-3.9.9.tar.gz/ffhevc
Changed
@@ -2,8 +2,8 @@ # # Small script to encode to H.265/HEVC video using FFmpeg and libx265. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 3.9.8 -# Date: 2019-10-25 +# Version: 3.9.9 +# Date: 2019-10-26 # # ffhevc is free software ; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ brown() { echo -e "\e0;33m$1\e0;39;49m"; } error() { echo -e "\e1;31m$1\e0;39;49m"; } -version="3.9.8" +version="3.9.9" CFG="$HOME/.ffhevc" cfgversion="50" @@ -2434,15 +2434,40 @@ # support strict="-strict -2" + if ! -z "$batchmode" ; then + echo + error "-> Due to current codebase limitations, automatic audio metadata" + error " will be that of the first input file provided. If all input files" + error " have the same audio properties (bit depth, sample rate, etc)" + error " this won't be an issue. Usually, complete seasons of film series" + error " have the same audio properties." + error " Otherwise you may want to:" + echo + error "-> Disable auto metadata completely" + echo + error "-> Enable it but you will need to modify the batchfile yourself and" + error " update the data to reflect the correct audio properties. Then" + error " encode from there." + echo + printf "Disable Automatic Audio Metadata? y/N: " + read noautometa + if "$noautometa" = "y" -o "$noautometa" = "Y" ; then + noaudmeta="1" + fi + echo + fi + for i in $(eval echo "{1..$ATRACKS}"); do audindexi="$(($i-1))" printf "Track $i: Specify the Audio Track to Encode or Copy default is 0:1: " read astreami test -z "${astreami}" && atracki="0:1" || atracki="${astreami}" + + audmapi="-map ${atracki}" + printf "Track $i: Specify the 3-letter Language Code for Metadata press 'Enter' to skip: " read alangi test ! -z "${alangi}" && audlangi="-metadata:s:a:${audindexi} language=${alangi}" - audmapi="-map ${atracki}" done if -z "$DEFAULT_AUD_CODEC" ; then @@ -2566,14 +2591,14 @@ flac) acdci="flac" acdcmetai="FLAC" - abroptsi="0-12" + abroptsi="0(low)-12(high)" abrdefi="5" skiptfs="1" ;; alac) acdci="alac" acdcmetai="ALAC" - abroptsi="0-12" + abroptsi="0(low)-12(high)" abrdefi="5" skiptfs="1" ;; @@ -2638,13 +2663,14 @@ esac done + aidxi="$(($(echo "${atracki}" | awk -F: '{print $2}')-1))" + test "${aidxi}" = "-1" && aidxi="0" + if "${acodeci}" != "copy" ; then - aidi="$(($(echo "${atracki}" | awk -F: '{print $2}')-1))" - test "${aidi}" = "-1" && aidi="0" - GETAUDBDi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBDi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" if ! -z "${GETAUDBDi}" ; then case "${GETAUDBDi}" in - 1-9*) abdmetai=", ${GETAUDBDi} bits src" ;; + 1-9*) abdmetai=", ${GETAUDBDi} bits input" ;; esac fi case "${acodeci}" in @@ -2719,15 +2745,20 @@ dts) chanrangei="1/2/4/5/6"; defchani="6" ;; fdk*) case "${aacprofi}" in - aac_low|aac_he|aac_ld) chanrangei="1-8"; defchani="8" ;; - *) chanrangei="1-2"; defchani="2" ;; + aac_he_v2) true ;; + *) chanrangei="1-8"; defchani="8" ;; esac ;; esac - printf "Track $i: How many Channels to Encode? ${chanrangei} - default is ${defchani}: " - read achani - test -z "${achani}" && achi="${defchani}" || achi="${achani}" + case "${aacprofi}" in + aac_he_v2) achi="2" ;; + ""|*) + printf "Track $i: How many Channels to Encode? ${chanrangei} - default is ${defchani}: " + read achani + test -z "${achani}" && achi="${defchani}" || achi="${achani}" + ;; + esac case "${acodeci}" in ac3|eac3) case "${achi}" in @@ -2761,15 +2792,7 @@ ;; fdk*) case "${aacprofi}" in - aac_he_v2) - case "${achi}" in - 1|2) true ;; - *) - error "-> HE-AACv2 supports only 1-2 channels!" - exit 1 - ;; - esac - ;; + aac_he_v2) true ;; *) case "${achi}" in 1-6|8) true ;; @@ -2884,25 +2907,30 @@ esac ;; fdk*) - echo " 0 -> Mono 4 -> 5.0" - echo " 1 -> Stereo 5 -> 5.1" - echo " 2 -> 3.0 6 -> 7.1" - echo " 3 -> 4.0 7 -> 7.1(wide)" - echo - printf "Track $i: Specify the Audio Channel Layout default is 6: " - read achanlayouti - case "${achanlayouti}" in - 0) achlayouti="mono"; achmetai=" Mono" ;; - 1) achlayouti="stereo"; achmetai=" Stereo" ;; - 2) achlayouti="3.0"; achmetai=" 3.0" ;; - 3) achlayouti="4.0"; achmetai=" 4.0" ;; - 4) achlayouti="5.0"; achmetai=" 5.0" ;; - 5) achlayouti="5.1"; achmetai=" 5.1" ;; - 6|"") achlayouti="7.1"; achmetai=" 7.1" ;; - 7) achlayouti="7.1(wide)"; achmetai=" 7.1(wide)" ;; + case "${aacprofi}" in + aac_he_v2) achlayouti="stereo"; achmetai=" Stereo" ;; *) - error "-> Invalid option!" - exit 1 + echo " 0 -> Mono 4 -> 5.0" + echo " 1 -> Stereo 5 -> 5.1" + echo " 2 -> 3.0 6 -> 7.1" + echo " 3 -> 4.0 7 -> 7.1(wide)" + echo + printf "Track $i: Specify the Audio Channel Layout default is 6: " + read achanlayouti + case "${achanlayouti}" in + 0) achlayouti="mono"; achmetai=" Mono" ;; + 1) achlayouti="stereo"; achmetai=" Stereo" ;; + 2) achlayouti="3.0"; achmetai=" 3.0" ;; + 3) achlayouti="4.0"; achmetai=" 4.0" ;; + 4) achlayouti="5.0"; achmetai=" 5.0" ;; + 5) achlayouti="5.1"; achmetai=" 5.1" ;; + 6|"") achlayouti="7.1"; achmetai=" 7.1" ;; + 7) achlayouti="7.1(wide)"; achmetai=" 7.1(wide)" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac ;; esac ;; @@ -3114,7 +3142,7 @@ echo green "-> Track $i: detecting audio sample rate..." sleep 1 - GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" if ! -z "${GETAUDSRi}" ; then green "-> Track $i: detected ${GETAUDSRi} Hz" else @@ -3312,13 +3340,13 @@ fi if -z "${audhzi}" ; then - GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${GETAUDSRi}" in 1-9*) ahzmetai=", ${GETAUDSRi} Hz" ;; esac fi - audmetai="-metadata:s:a:${audindexi} title=\"${acdcmetai}${achmetai}${abtrmetai}${abdmetai}${ahzmetai}\"" + audmetai="-metadata:s:a:${audindexi} title=\"${acdcmetai}${achmetai}${abtrmetai}${ahzmetai}${abdmetai}\"" audchani="-ac:a:${audindexi} ${achi} -channel_layout:a:${audindexi} \"${achlayouti}\"" afiltersi="$(echo "${aresamplei}${anormalizei}${avolumei}$atempo" | sed 's|,$||')" @@ -3326,19 +3354,15 @@ test ! -z "${afiltersi}" && audfiltersi="-filter:a:${audindexi} ${afiltersi}" else if -z "$batchmode" ; then - aidi="$(($(echo "${atracki}" | awk -F: '{print $2}')-1))" - test "${aidi}" = "-1" && aidi="0" - - GETAUDCDCi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 | tail -1)" - + GETAUDCDCi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 | tail -1)" if ! -z "${GETAUDCDCi}" ; then - GETAUDBTRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDBDi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDCLi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=channel_layout -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBTRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBDi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSRi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDCLi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=channel_layout -of default=noprint_wrappers=1:nokey=1 | tail -1)" get_audio_profile_func() { - GETAUDPROFi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=profile -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDPROFi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=profile -of default=noprint_wrappers=1:nokey=1 | tail -1)" } case "${GETAUDCDCi}" in @@ -3383,7 +3407,7 @@ mono) achmetai=" Mono" ;; stereo) achmetai=" Stereo" ;; unknown|N/A|"") - GETAUDCHi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=channels -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDCHi="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=channels -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${GETAUDCHi}" in 1) achmetai=" Mono" ;; 2) achmetai=" Stereo" ;; @@ -3408,12 +3432,17 @@ case "${GETAUDSRi}" in 1-9*) asrmetai=", ${GETAUDSRi} Hz" ;; esac - audmetai="-metadata:s:a:${audindexi} title=\"${GETAUDCDCi}${achmetai}${abtrmetai}${abdmetai}${asrmetai}\"" + audmetai="-metadata:s:a:${audindexi} title=\"${GETAUDCDCi}${achmetai}${abtrmetai}${asrmetai}${abdmetai}\"" fi fi fi - audparamsi="${audmapi} -c:a:${audindexi} ${acdci} ${audprofilei} ${audcompleveli} ${audbtri} ${audchani} ${audbdi} ${auddialnormi} ${audfiltersi} ${audlangi} ${audmetai} ${auddispoi}" + if -z "$noaudmeta" ; then + audparamsi="${audmapi} -c:a:${audindexi} ${acdci} ${audprofilei} ${audcompleveli} ${audbtri} ${audchani} ${audbdi} ${auddialnormi} ${audfiltersi} ${audlangi} ${audmetai} ${auddispoi}" + else + audparamsi="${audmapi} -c:a:${audindexi} ${acdci} ${audprofilei} ${audcompleveli} ${audbtri} ${audchani} ${audbdi} ${auddialnormi} ${audfiltersi} ${audlangi} ${auddispoi}" + fi + done fi @@ -3461,8 +3490,7 @@ # Audio copy, get bitrate for i in $(eval echo "{1..$ATRACKS}"); do if "${acodeci}" = "copy" ; then - aidi="$(($(echo "${atracki}" | awk -F: '{print $2}')-1))" - abtri="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidi} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + abtri="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidxi} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${abtri}" in 1-9*) abitratei="$((${abtri}/1000))" ;; ""|*) abitratei="0" ;; @@ -3613,7 +3641,7 @@ esac echo "echo" >> "$OUTFILE" echo "green \"-> Adding cover image...\"" >> "$OUTFILE" - echo "$MP4BOX -add \"$OUTPUT\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$CONFMT\" >/dev/null 2>&1" >> "$OUTFILE" + echo "$MP4BOX -add \"$OUTPUT\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -tmp \"$(dirname "$OUTPUT")\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$CONFMT\" >/dev/null 2>&1" >> "$OUTFILE" echo "RET=\$?" >> "$OUTFILE" echo "test \"\$RET\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" echo "if \"\$RET\" = \"0\" ; then" >> "$OUTFILE" @@ -3657,7 +3685,7 @@ echo "" >> "$OUTFILE" echo "echo" >> "$OUTFILE" echo "green \"-> Adding cover image...\"" >> "$OUTFILE" - echo "$MP4BOX -add \"${OUTPUT%.*}.$i\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$i\" >/dev/null 2>&1" >> "$OUTFILE" + echo "$MP4BOX -add \"${OUTPUT%.*}.$i\"$color -itags cover=\"$(readlink -e "$cover")\":name=\"$(basename "${OUTPUT%.*}")\":genre=\"$genre\":created=\"$year\":comment=\"$COMMENT\" -tmp \"$(dirname "$OUTPUT")\" -mpeg4 -new \"${OUTPUT%.*}_COVER_$$.$i\" >/dev/null 2>&1" >> "$OUTFILE" echo "RET=\$?" >> "$OUTFILE" echo "test \"\$RET\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" echo "if \"\$RET\" = \"0\" ; then" >> "$OUTFILE"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.