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 aid[i] to aidx[i] 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 aidx[i] 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 aid[i] to aidx[i] 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 aidx[i] 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 "\e[0;33m$1\e[0;39;49m"; } error() { echo -e "\e[1;31m$1\e[0;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 audindex[i]="$(($i-1))" printf "Track $i: Specify the Audio Track to Encode or Copy [default is 0:1]: " read astream[i] test -z "${astream[i]}" && atrack[i]="0:1" || atrack[i]="${astream[i]}" + + audmap[i]="-map ${atrack[i]}" + printf "Track $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " read alang[i] test ! -z "${alang[i]}" && audlang[i]="-metadata:s:a:${audindex[i]} language=${alang[i]}" - audmap[i]="-map ${atrack[i]}" done if [ -z "$DEFAULT_AUD_CODEC" ]; then @@ -2566,14 +2591,14 @@ flac) acdc[i]="flac" acdcmeta[i]="FLAC" - abropts[i]="0-12" + abropts[i]="0(low)-12(high)" abrdef[i]="5" skiptfs="1" ;; alac) acdc[i]="alac" acdcmeta[i]="ALAC" - abropts[i]="0-12" + abropts[i]="0(low)-12(high)" abrdef[i]="5" skiptfs="1" ;; @@ -2638,13 +2663,14 @@ esac done + aidx[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" + test "${aidx[i]}" = "-1" && aidx[i]="0" + if [ "${acodec[i]}" != "copy" ]; then - aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" - test "${aid[i]}" = "-1" && aid[i]="0" - GETAUDBD[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBD[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" if [ ! -z "${GETAUDBD[i]}" ]; then case "${GETAUDBD[i]}" in - [1-9]*) abdmeta[i]=", ${GETAUDBD[i]} bits src" ;; + [1-9]*) abdmeta[i]=", ${GETAUDBD[i]} bits input" ;; esac fi case "${acodec[i]}" in @@ -2719,15 +2745,20 @@ dts) chanrange[i]="1/2/4/5/6"; defchan[i]="6" ;; fdk*) case "${aacprof[i]}" in - aac_low|aac_he|aac_ld) chanrange[i]="1-8"; defchan[i]="8" ;; - *) chanrange[i]="1-2"; defchan[i]="2" ;; + aac_he_v2) true ;; + *) chanrange[i]="1-8"; defchan[i]="8" ;; esac ;; esac - printf "Track $i: How many Channels to Encode? [${chanrange[i]} - default is ${defchan[i]}]: " - read achan[i] - test -z "${achan[i]}" && ach[i]="${defchan[i]}" || ach[i]="${achan[i]}" + case "${aacprof[i]}" in + aac_he_v2) ach[i]="2" ;; + ""|*) + printf "Track $i: How many Channels to Encode? [${chanrange[i]} - default is ${defchan[i]}]: " + read achan[i] + test -z "${achan[i]}" && ach[i]="${defchan[i]}" || ach[i]="${achan[i]}" + ;; + esac case "${acodec[i]}" in ac3|eac3) case "${ach[i]}" in @@ -2761,15 +2792,7 @@ ;; fdk*) case "${aacprof[i]}" in - aac_he_v2) - case "${ach[i]}" in - 1|2) true ;; - *) - error "-> HE-AACv2 supports only 1-2 channels!" - exit 1 - ;; - esac - ;; + aac_he_v2) true ;; *) case "${ach[i]}" 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 achanlayout[i] - case "${achanlayout[i]}" in - 0) achlayout[i]="mono"; achmeta[i]=" Mono" ;; - 1) achlayout[i]="stereo"; achmeta[i]=" Stereo" ;; - 2) achlayout[i]="3.0"; achmeta[i]=" 3.0" ;; - 3) achlayout[i]="4.0"; achmeta[i]=" 4.0" ;; - 4) achlayout[i]="5.0"; achmeta[i]=" 5.0" ;; - 5) achlayout[i]="5.1"; achmeta[i]=" 5.1" ;; - 6|"") achlayout[i]="7.1"; achmeta[i]=" 7.1" ;; - 7) achlayout[i]="7.1(wide)"; achmeta[i]=" 7.1(wide)" ;; + case "${aacprof[i]}" in + aac_he_v2) achlayout[i]="stereo"; achmeta[i]=" 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 achanlayout[i] + case "${achanlayout[i]}" in + 0) achlayout[i]="mono"; achmeta[i]=" Mono" ;; + 1) achlayout[i]="stereo"; achmeta[i]=" Stereo" ;; + 2) achlayout[i]="3.0"; achmeta[i]=" 3.0" ;; + 3) achlayout[i]="4.0"; achmeta[i]=" 4.0" ;; + 4) achlayout[i]="5.0"; achmeta[i]=" 5.0" ;; + 5) achlayout[i]="5.1"; achmeta[i]=" 5.1" ;; + 6|"") achlayout[i]="7.1"; achmeta[i]=" 7.1" ;; + 7) achlayout[i]="7.1(wide)"; achmeta[i]=" 7.1(wide)" ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac ;; esac ;; @@ -3114,7 +3142,7 @@ echo green "-> Track $i: detecting audio sample rate..." sleep 1 - GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" if [ ! -z "${GETAUDSR[i]}" ]; then green "-> Track $i: detected ${GETAUDSR[i]} Hz" else @@ -3312,13 +3340,13 @@ fi if [ -z "${audhz[i]}" ]; then - GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${GETAUDSR[i]}" in [1-9]*) ahzmeta[i]=", ${GETAUDSR[i]} Hz" ;; esac fi - audmeta[i]="-metadata:s:a:${audindex[i]} title=\"${acdcmeta[i]}${achmeta[i]}${abtrmeta[i]}${abdmeta[i]}${ahzmeta[i]}\"" + audmeta[i]="-metadata:s:a:${audindex[i]} title=\"${acdcmeta[i]}${achmeta[i]}${abtrmeta[i]}${ahzmeta[i]}${abdmeta[i]}\"" audchan[i]="-ac:a:${audindex[i]} ${ach[i]} -channel_layout:a:${audindex[i]} \"${achlayout[i]}\"" afilters[i]="$(echo "${aresample[i]}${anormalize[i]}${avolume[i]}$atempo" | sed 's|,$||')" @@ -3326,19 +3354,15 @@ test ! -z "${afilters[i]}" && audfilters[i]="-filter:a:${audindex[i]} ${afilters[i]}" else if [ -z "$batchmode" ]; then - aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" - test "${aid[i]}" = "-1" && aid[i]="0" - - GETAUDCDC[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 | tail -1)" - + GETAUDCDC[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 | tail -1)" if [ ! -z "${GETAUDCDC[i]}" ]; then - GETAUDBTR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDBD[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" - GETAUDCL[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=channel_layout -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBTR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDBD[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=bits_per_raw_sample -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDSR[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDCL[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=channel_layout -of default=noprint_wrappers=1:nokey=1 | tail -1)" get_audio_profile_func() { - GETAUDPROF[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=profile -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDPROF[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=profile -of default=noprint_wrappers=1:nokey=1 | tail -1)" } case "${GETAUDCDC[i]}" in @@ -3383,7 +3407,7 @@ mono) achmeta[i]=" Mono" ;; stereo) achmeta[i]=" Stereo" ;; unknown|N/A|"") - GETAUDCH[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=channels -of default=noprint_wrappers=1:nokey=1 | tail -1)" + GETAUDCH[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=channels -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${GETAUDCH[i]}" in 1) achmeta[i]=" Mono" ;; 2) achmeta[i]=" Stereo" ;; @@ -3408,12 +3432,17 @@ case "${GETAUDSR[i]}" in [1-9]*) asrmeta[i]=", ${GETAUDSR[i]} Hz" ;; esac - audmeta[i]="-metadata:s:a:${audindex[i]} title=\"${GETAUDCDC[i]}${achmeta[i]}${abtrmeta[i]}${abdmeta[i]}${asrmeta[i]}\"" + audmeta[i]="-metadata:s:a:${audindex[i]} title=\"${GETAUDCDC[i]}${achmeta[i]}${abtrmeta[i]}${asrmeta[i]}${abdmeta[i]}\"" fi fi fi - audparams[i]="${audmap[i]} -c:a:${audindex[i]} ${acdc[i]} ${audprofile[i]} ${audcomplevel[i]} ${audbtr[i]} ${audchan[i]} ${audbd[i]} ${auddialnorm[i]} ${audfilters[i]} ${audlang[i]} ${audmeta[i]} ${auddispo[i]}" + if [ -z "$noaudmeta" ]; then + audparams[i]="${audmap[i]} -c:a:${audindex[i]} ${acdc[i]} ${audprofile[i]} ${audcomplevel[i]} ${audbtr[i]} ${audchan[i]} ${audbd[i]} ${auddialnorm[i]} ${audfilters[i]} ${audlang[i]} ${audmeta[i]} ${auddispo[i]}" + else + audparams[i]="${audmap[i]} -c:a:${audindex[i]} ${acdc[i]} ${audprofile[i]} ${audcomplevel[i]} ${audbtr[i]} ${audchan[i]} ${audbd[i]} ${auddialnorm[i]} ${audfilters[i]} ${audlang[i]} ${auddispo[i]}" + fi + done fi @@ -3461,8 +3490,7 @@ # Audio copy, get bitrate for i in $(eval echo "{1..$ATRACKS}"); do if [ "${acodec[i]}" = "copy" ]; then - aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" - abtr[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aid[i]} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" + abtr[i]="$($FFPROBE -i "$input" -v quiet -select_streams a:${aidx[i]} -show_entries stream=bit_rate -of default=noprint_wrappers=1:nokey=1 | tail -1)" case "${abtr[i]}" in [1-9]*) abitrate[i]="$((${abtr[i]}/1000))" ;; ""|*) abitrate[i]="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
.