Projects
Multimedia
ffxvid
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 76
View file
ffxvid.changes
Changed
@@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Sat Oct 26 07:05:00 UTC 2019 - neutrino8@opensuse.org + +- Update to version 1.5.6 +* 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 1.5.5
View file
ffxvid.spec
Changed
@@ -17,7 +17,7 @@ Name: ffxvid -Version: 1.5.5 +Version: 1.5.6 Release: 0 Summary: A small shell script for encoding to Xvid with FFmpeg License: GPL-2.0+
View file
ffxvid-1.5.5.tar.gz/ChangeLog -> ffxvid-1.5.6.tar.gz/ChangeLog
Changed
@@ -1,3 +1,16 @@ +2019-10-26 - ffxvid 1.5.6 + * 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 - ffxvid 1.5.5 * Detect audio bit depth and add it to the audio metadata * Added detection for DTS Express and DTS-HD HR for audio copy
View file
ffxvid-1.5.5.tar.gz/ffxvid -> ffxvid-1.5.6.tar.gz/ffxvid
Changed
@@ -2,8 +2,8 @@ # # Small script to encode to Xvid video using FFmpeg. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 1.5.5 -# Date: 2019-10-25 +# Version: 1.5.6 +# Date: 2019-10-26 # # ffx264 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="1.5.5" +version="1.5.6" CFG="$HOME/.ffxvid" cfgversion="14" @@ -2159,15 +2159,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 @@ -2293,14 +2318,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" ;; @@ -2375,13 +2400,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 @@ -2456,15 +2482,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 @@ -2498,15 +2529,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 ;; @@ -2621,25 +2644,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 ;; @@ -2851,7 +2879,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 @@ -3049,13 +3077,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|,$||')" @@ -3063,19 +3091,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 @@ -3121,7 +3145,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" ;; @@ -3146,12 +3170,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 @@ -3199,8 +3228,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" ;; @@ -3336,7 +3364,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" @@ -3384,7 +3412,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
.