Projects
Multimedia
ffx264
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 11
View file
ffx264.changes
Changed
@@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Mon Nov 07 16:25:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 2.9.5 + * Cosmetics in the code for deinterlacing + * Instead of skipping FPS conversion if the FPS can't be detected, + ask the user to provide it + * Use single brackets instead of double ones in the nosound + setup code + * Added license snippet at the top of the script + * Added support for outputting to additional container formats + * Do some checking on supported audio codecs for the supported + containers + * Check specified container and warn and exit if it's not supported + * Support setting the FLAC compression level + * Added h264_mp4toannexb flag in case we're outputting to the AVI + container + * Break out of the if conditionals in the audio code and replace + them with two case statements + * Update to the README file + +------------------------------------------------------------------- Sun Nov 06 09:52:00 UTC 2016 - neutrino8@opensuse.org - Update to version 3.1.0
View file
ffx264.spec
Changed
@@ -17,7 +17,7 @@ Name: ffx264 -Version: 3.1.0 +Version: 3.1.1 Release: 0 Summary: A small shell script for encoding to H.264 with ffmpeg License: GPL-2.0+
View file
ffx264-3.1.0.tar.gz/ChangeLog -> ffx264-3.1.1.tar.gz/ChangeLog
Changed
@@ -1,3 +1,21 @@ +2016-11-07 - ffx264 3.1.1 + * Cosmetics in the code for deinterlacing + * Instead of skipping FPS conversion if the FPS can't be detected, + ask the user to provide it + * Use single brackets instead of double ones in the nosound + setup code + * Added license snippet at the top of the script + * Added support for outputting to additional container formats + * Do some checking on supported audio codecs for the supported + containers + * Check specified container and warn and exit if it's not supported + * Support setting the FLAC compression level + * Added h264_mp4toannexb flag in case we're outputting to the AVI + container + * Break out of the if conditionals in the audio code and replace + them with two case statements + * Update to the README file + 2016-11-06 - ffx264 3.1.0 * Bugfix: resampling wasn't working for fdk-aac due to missing value in the case statement
View file
ffx264-3.1.0.tar.gz/README -> ffx264-3.1.1.tar.gz/README
Changed
@@ -27,6 +27,7 @@ - it supports cover art for the MKV container. - it supports the x264 presets and tune profiles. - it supports custom written preset files. +- it can output to more than one container. Parameters:
View file
ffx264-3.1.0.tar.gz/ffx264 -> ffx264-3.1.1.tar.gz/ffx264
Changed
@@ -2,15 +2,28 @@ # # Small script to encode to H.264/AVC video using FFmpeg and libx264. # Author: Grozdan "microchip" Nikolov <neutrino8@opensuse.org> -# Version: 3.1.0 -# Date: 2016-11-06 -# License: GNU GPLv2+ +# Version: 3.1.1 +# Date: 2016-11-07 +# +# ffx264 is free software ; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation ; either version 2 of the License, or +# (at your option) any later version. +# +# ffx264 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY ; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program ; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA green() { echo -e "\e[1;32m$1\e[0;39;49m"; } brown() { echo -e "\e[0;33m$1\e[0;39;49m"; } error() { echo -e "\e[1;31m$1\e[0;39;49m"; } -version="3.1.0" +version="3.1.1" CFG="$HOME/.ffx264" cfgversion="24" @@ -356,11 +369,68 @@ read confmt test -z "$confmt" && CON="mkv" || CON="$confmt" fi + CON="$(echo "$CON" | tr '[:upper:]' '[:lower:]')" + case "$CON" in mp4|m4v|mov) movflags="-movflags +faststart" ;; + avi) annexb="-bsf:v h264_mp4toannexb" ;; + mkv) true ;; + *) + error "-> H.264 video not supported by chosen container!" + error "-> Supported containers are: mkv, mp4, mov, m4v and avi" + error "-> Check your config file, if needed, in '$CFG'" + exit 1 + ;; esac + printf "Output to Additional Container Formats? [y/N]: " + read acf + if [ "$acf" = "y" -o "$acf" = "Y" ]; then + printf "Specify the Container Formats [example: mp4,mov,avi - press 'Enter' to skip]: " + read econ + test ! -z "$econ" && extracon="$(echo "$econ" | sed 's|,| |g' | tr '[:upper:]' '[:lower:]')" + if [ ! -z "$extracon" ]; then + for i in $extracon; do + if [ "$i" = "$CON" ]; then + error "-> Additional container matches the main output container!" + exit 1 + fi + case "$i" in + mkv|mp4|mov|m4v|avi) true ;; + *) + error "-> H.264 video not supported by the $i container!" + error "-> Supported containers are: mkv, mp4, mov, m4v and avi" + exit 1 + ;; + esac + echo + case "$i" in + mkv) + green "-> Note: additional container $i supports all the audio codecs" + ;; + mp4) + green "-> Note: additional container $i supports the following audio codecs:" + green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|copy|nosound" + ;; + mov) + green "-> Note: additional container $i supports the following audio codecs:" + green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|flac|copy|nosound" + ;; + m4v) + green "-> Note: additional container $i supports the following audio codecs:" + green "-> ac3|aac|fdk-aac|copy|nosound" + ;; + avi) + green "-> Note: additional container $i supports the following audio codecs:" + green "-> ac3|eac3|dts|aac|fdk-aac|mp3|vorbis|pcm|flac|copy|nosound" + ;; + esac + done + echo + fi + fi + OUTPUT="$OUTPUT.$CON" test -e "$OUTPUT" && mv -f "$OUTPUT" "$OUTPUT.old" @@ -529,8 +599,8 @@ esac green "-> Detected $fparity Parity" if [ "$fp" = "progressive" ]; then - error "-> Your file appears to be progressive but" - error " this may be a misdetection!" + error "-> The video stream appears to be progressive" + error " but this may be a misdetection!" elif [ "$fp" = "???" ]; then error "-> Could not detect the Field Parity!" fi @@ -577,16 +647,15 @@ video_fps_func if [ ! -z "$GETFPS" ]; then FPS1="$(echo "$GETFPS" | awk -F/ '{print $1}')" - FPS2="$(echo "$GETFPS"| awk -F/ '{print $2}')" + FPS2="$(echo "$GETFPS" | awk -F/ '{print $2}')" OFPS="$(($FPS1*2))/$FPS2" green "-> Detected: $FPS1/$FPS2 FPS" green "-> Setting output FPS to: $OFPS" - echo ofps="-r $OFPS" else error "-> Could not detect the FPS value!" - echo fi + echo video_deinterlace_func bob bob="1" ;; @@ -752,7 +821,7 @@ sleep 1 video_fps_func if [ ! -z "$GETFPS" ]; then - green "-> Detected: $GETFPS FPS" + green "-> Detected $GETFPS FPS" else error "-> Could not detect the FPS value!" fi @@ -762,141 +831,147 @@ echo error "-> Detected FPS is not supported yet!" error "-> Supported FPS are: 24/1, 25/1, 24000/1001 and 30000/1001" - error "-> Skipping FPS conversion!" - skipfps="1" + echo + printf "Specify the FPS value of the Input File [no default!]: " + read infps + case "$infps" in + 24/1|25/1|24000/1001|30000/1001) true ;; + ""|*) + error "-> No value or unsupported value given!" + exit 1 + ;; + esac ;; esac echo - if [ -z "$skipfps" ]; then - brown " FPS Conversion Filters" - brown " ~~~~~~~~~~~~~~~~~~~~~~" - echo " 0 -> fps (converts by duplicating/dropping of frames)" - echo " 1 -> setpts + atempo (converts by PTS + audio speedup/down)" - echo - printf "Specify the FPS conversion method [default is 0]: " - read fcm + brown " FPS Conversion Filters" + brown " ~~~~~~~~~~~~~~~~~~~~~~" + echo " 0 -> fps (converts by duplicating/dropping of frames)" + echo " 1 -> setpts + atempo (converts by PTS + audio speedup/down)" + echo + printf "Specify the FPS conversion method [default is 0]: " + read fcm + case "$fcm" in + 0|1|"") true ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac + echo + brown " NTSC <-> PAL and NTSC <-> NTSC FPS Conversion" + brown " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo " 0 --> 23.976 FPS (24000/1001) to 24 FPS" + echo " 1 --> 23.976 FPS (24000/1001) to 25 FPS" + echo " 2 --> 23.976 FPS (24000/1001) to 29.970 FPS" + echo + echo " 3 --> 24 FPS to 23.976 FPS (24000/1001)" + echo " 4 --> 24 FPS to 25 FPS" + echo " 5 --> 24 FPS to 29.970 FPS (30000/1001)" + echo + echo " 6 --> 25 FPS to 23.976 FPS (24000/1001)" + echo " 7 --> 25 FPS to 24 FPS" + echo " 8 --> 25 FPS to 29.970 FPS (30000/1001)" + echo + echo " 9 --> 29.970 FPS (30000/1001) to 23.976 FPS (24000/1001)" + echo " 10 -> 29.970 FPS (30000/1001) to 24 FPS" + echo " 11 -> 29.970 FPS (30000/1001) to 25 FPS" + echo + printf "Specify the FPS Conversion option [press 'Enter' to skip]: " + read fpsopt + case "$fpsopt" in + 0) case "$fcm" in - 0|1|"") true ;; - *) - error "-> Invalid option!" - exit 1 - ;; + 0|"") fps="fps=fps=24," ;; + 1) setpts="setpts=23976/24000*PTS,"; atempo="atempo=1.001001001," ;; esac - echo - brown " NTSC <-> PAL and NTSC <-> NTSC FPS Conversion" - brown " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - echo " 0 --> 23.976 FPS (24000/1001) to 24 FPS" - echo " 1 --> 23.976 FPS (24000/1001) to 25 FPS" - echo " 2 --> 23.976 FPS (24000/1001) to 29.970 FPS" - echo - echo " 3 --> 24 FPS to 23.976 FPS (24000/1001)" - echo " 4 --> 24 FPS to 25 FPS" - echo " 5 --> 24 FPS to 29.970 FPS (30000/1001)" - echo - echo " 6 --> 25 FPS to 23.976 FPS (24000/1001)" - echo " 7 --> 25 FPS to 24 FPS" - echo " 8 --> 25 FPS to 29.970 FPS (30000/1001)" - echo - echo " 9 --> 29.970 FPS (30000/1001) to 23.976 FPS (24000/1001)" - echo " 10 -> 29.970 FPS (30000/1001) to 24 FPS" - echo " 11 -> 29.970 FPS (30000/1001) to 25 FPS" - echo - printf "Specify the FPS Conversion option [press 'Enter' to skip]: " - read fpsopt - case "$fpsopt" in - 0) - case "$fcm" in - 0|"") fps="fps=fps=24," ;; - 1) setpts="setpts=23976/24000*PTS,"; atempo="atempo=1.001001001," ;; - esac - ofps="-r 24/1" - ;; - 1) - case "$fcm" in - 0|"") fps="fps=fps=25," ;; - 1) setpts="setpts=23976/25000*PTS,"; atempo="atempo=1.04270937604270937604," ;; - esac - ofps="-r 25/1" - ;; - 2) - case "$fcm" in - 0|"") fps="fps=fps=30000/1001," ;; - 1) setpts="setpts=23976/29970*PTS,"; atempo="atempo=1.25," ;; - esac - ofps="-r 30000/1001" - ;; - 3) - case "$fcm" in - 0|"") fps="fps=fps=24000/1001," ;; - 1) setpts="setpts=24000/23976*PTS,"; atempo="atempo=0.999," ;; - esac - ofps="-r 24000/1001" - ;; - 4) - case "$fcm" in - 0|"") fps="fps=fps=25," ;; - 1) setpts="setpts=24000/25000*PTS,"; atempo="atempo=1.04166666667," ;; - esac - ofps="-r 25/1" - ;; - 5) - case "$fcm" in - 0|"") fps="fps=fps=30000/1001," ;; - 1) setpts="setpts=24000/29970*PTS,"; atempo="atempo=1.24875," ;; - esac - ofps="-r 30000/1001" - ;; - 6) - case "$fcm" in - 0|"") fps="fps=fps=24000/1001," ;; - 1) setpts="setpts=25000/23976*PTS,"; atempo="atempo=0.95904," ;; - esac - ofps="-r 24000/1001" - ;; - 7) - case "$fcm" in - 0|"") fps="fps=fps=24," ;; - 1) setpts="setpts=25000/24000*PTS,"; atempo="atempo=0.96," ;; - esac - ofps="-r 24/1" - ;; - 8) - case "$fcm" in - 0|"") fps="fps=fps=30000/1001," ;; - 1) setpts="setpts=25000/29970*PTS,"; atempo="atempo=1.1988," ;; - esac - ofps="-r 30000/1001" - ;; - 9) - case "$fcm" in - 0|"") fps="fps=fps=24000/1001," ;; - 1) setpts="setpts=29970/23976*PTS,"; atempo="atempo=0.8," ;; - esac - ofps="-r 24000/1001" - ;; - 10) - case "$fcm" in - 0|"") fps="fps=fps=24," ;; - 1) setpts="setpts=29970/24000*PTS,"; atempo="atempo=0.800800800801," ;; - esac - ofps="-r 24/1" - ;; - 11) - case "$fcm" in - 0|"") fps="fps=fps=25," ;; - 1) setpts="setpts=29970/25000*PTS,"; atempo="atempo=0.83416750083416750083," ;; - esac - ofps="-r 25/1" - ;; - "") - true - ;; - *) - error "-> Invalid option!" - exit 1 - ;; + ofps="-r 24/1" + ;; + 1) + case "$fcm" in + 0|"") fps="fps=fps=25," ;; + 1) setpts="setpts=23976/25000*PTS,"; atempo="atempo=1.04270937604270937604," ;; esac - fi + ofps="-r 25/1" + ;; + 2) + case "$fcm" in + 0|"") fps="fps=fps=30000/1001," ;; + 1) setpts="setpts=23976/29970*PTS,"; atempo="atempo=1.25," ;; + esac + ofps="-r 30000/1001" + ;; + 3) + case "$fcm" in + 0|"") fps="fps=fps=24000/1001," ;; + 1) setpts="setpts=24000/23976*PTS,"; atempo="atempo=0.999," ;; + esac + ofps="-r 24000/1001" + ;; + 4) + case "$fcm" in + 0|"") fps="fps=fps=25," ;; + 1) setpts="setpts=24000/25000*PTS,"; atempo="atempo=1.04166666667," ;; + esac + ofps="-r 25/1" + ;; + 5) + case "$fcm" in + 0|"") fps="fps=fps=30000/1001," ;; + 1) setpts="setpts=24000/29970*PTS,"; atempo="atempo=1.24875," ;; + esac + ofps="-r 30000/1001" + ;; + 6) + case "$fcm" in + 0|"") fps="fps=fps=24000/1001," ;; + 1) setpts="setpts=25000/23976*PTS,"; atempo="atempo=0.95904," ;; + esac + ofps="-r 24000/1001" + ;; + 7) + case "$fcm" in + 0|"") fps="fps=fps=24," ;; + 1) setpts="setpts=25000/24000*PTS,"; atempo="atempo=0.96," ;; + esac + ofps="-r 24/1" + ;; + 8) + case "$fcm" in + 0|"") fps="fps=fps=30000/1001," ;; + 1) setpts="setpts=25000/29970*PTS,"; atempo="atempo=1.1988," ;; + esac + ofps="-r 30000/1001" + ;; + 9) + case "$fcm" in + 0|"") fps="fps=fps=24000/1001," ;; + 1) setpts="setpts=29970/23976*PTS,"; atempo="atempo=0.8," ;; + esac + ofps="-r 24000/1001" + ;; + 10) + case "$fcm" in + 0|"") fps="fps=fps=24," ;; + 1) setpts="setpts=29970/24000*PTS,"; atempo="atempo=0.800800800801," ;; + esac + ofps="-r 24/1" + ;; + 11) + case "$fcm" in + 0|"") fps="fps=fps=25," ;; + 1) setpts="setpts=29970/25000*PTS,"; atempo="atempo=0.83416750083416750083," ;; + esac + ofps="-r 25/1" + ;; + "") + true + ;; + *) + error "-> Invalid option!" + exit 1 + ;; + esac fi fi fi @@ -904,7 +979,7 @@ ################ Subs stuff ################# if [ "$SUBS" = "y" ]; then - test -z "$skipfps" && echo + echo green "-> Detecting subtitles..." sleep 1 SUBSDETECT="$($FFPROBE -i "$input" 2>&1 | grep 'Stream #' | grep 'Subtitle' | sed 's| ||g')" @@ -946,7 +1021,7 @@ ################ Audio stuff ################ -test -z "$skipfps" && echo +echo green "-> Detecting audio tracks..." echo sleep 1 @@ -1071,6 +1146,8 @@ flac) acdc[i]="flac" ameta[i]="FLAC" + abropts[i]="0-8" + abrdef[i]="5" skiptfs="1" ;; pcm) @@ -1099,7 +1176,7 @@ abitrate[1]="0" # nosound takes precedence so # clear any audio options given - if [[ $i -ge 2 ]]; then + if [ $i -ge 2 ]; then for t in $(eval echo "{2..$MAX_AUD_TRACKS}"); do audparams[t]= auddis[t]= @@ -1112,21 +1189,39 @@ exit 1 ;; esac - - if [ "$CON" != "mkv" ]; then + + case "$CON" in + mp4) case "${acodec[i]}" in - opus|flac) - error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is only supported by the MKV container!" + pcm|opus|flac) + error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the MP4 container!" error "-> Check your config file, if needed, in '$CFG'" exit 1 ;; esac - fi - case "$CON" in - mp4|m4v|mov|ogv) + ;; + mov) + case "${acodec[i]}" in + pcm|opus) + error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the MOV container!" + error "-> Check your config file, if needed, in '$CFG'" + exit 1 + ;; + esac + ;; + m4v) + case "${acodec[i]}" in + eac3|dts|vorbis|flac|pcm|opus) + error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the M4V container!" + error "-> Check your config file, if needed, in '$CFG'" + exit 1 + ;; + esac + ;; + avi) case "${acodec[i]}" in - dts|pcm) - error "-> DTS and PCM are not supported by the MP4/M4V/MOV/OGV container!" + opus) + error "-> $(echo "${acodec[i]}" | tr '[:lower:]' '[:upper:]') is not supported by the AVI container!" error "-> Check your config file, if needed, in '$CFG'" exit 1 ;; @@ -1135,45 +1230,52 @@ esac if [ "${acodec[i]}" != "copy" ]; then - if [ "${acodec[i]}" != "flac" ]; then - if [ "${acodec[i]}" != "pcm" ]; then - case "${acodec[i]}" in - fdk*) - printf "Track $i: Which AAC Profile to Use? [LC/HE/HEv2 - default is LC]: " - read aprof[i] - case "${aprof[i]}" in - lc|LC|"") ameta[i]="LC-AAC"; aacprof[i]="aac_low" ;; - he|HE) ameta[i]="HE-AACv1"; aacprof[i]="aac_he" ;; - hev2|HEv2|HEV2) ameta[i]="HE-AACv2"; aacprof[i]="aac_he_v2" ;; - *) - error "- Invalid AAC profile!" - exit 1 - ;; - esac - audprofile[i]="-profile:a:${audmapval[i]} ${aacprof[i]} -afterburner:a:${audmapval[i]} 1" - ;; - esac - printf "Track $i: Specify the Audio Bitrate in kbps [${abropts[i]} - default is ${abrdef[i]}]: " - read abr[i] - test -z "${abr[i]}" && abitrate[i]="${abrdef[i]}k" || abitrate[i]="${abr[i]}k" - audbtr[i]="-b:a:${audmapval[i]} ${abitrate[i]}" - abtrmeta[i]="@ $(echo "${abitrate[i]}" | sed 's|k||') kbps" - else - printf "Track $i: Which PCM Bit Depth to use? [16/24/32 - default is 24]: " - read pcmbd[i] - case "${pcmbd[i]}" in - 16) acdc[i]="pcm_s16le"; abtrmeta[i]="(16 bit)" ;; - 24|"") acdc[i]="pcm_s24le"; abtrmeta[i]="(24 bit)" ;; - 32) acdc[i]="pcm_s32le"; abtrmeta[i]="(32 bit)" ;; - *) - error "-> Unsupported PCM Bit Depth!" - exit 1 - ;; - esac - fi - else - abtrmeta[i]="(Lossless)" - fi + case "${acodec[i]}" in + fdk*) + printf "Track $i: Which AAC Profile to Use? [LC/HE/HEv2 - default is LC]: " + read aprof[i] + case "${aprof[i]}" in + lc|LC|"") ameta[i]="LC-AAC"; aacprof[i]="aac_low" ;; + he|HE) ameta[i]="HE-AACv1"; aacprof[i]="aac_he" ;; + hev2|HEv2|HEV2) ameta[i]="HE-AACv2"; aacprof[i]="aac_he_v2" ;; + *) + error "- Invalid AAC profile!" + exit 1 + ;; + esac + audprofile[i]="-profile:a:${audmapval[i]} ${aacprof[i]} -afterburner:a:${audmapval[i]} 1" + ;; + flac) + printf "Track $i: Specify the FLAC Compression Level [${abropts[i]} - default is ${abrdef[i]}]: " + read abr[i] + test -z "${abr[i]}" && acomplevel[i]="${abrdef[i]}" || acomplevel[i]="${abr[i]}" + audcomplevel[i]="-compression_level:a:${audmapval[i]} ${acomplevel[i]}" + abtrmeta[i]="@ CL ${acomplevel[i]}" + ;; + pcm) + printf "Track $i: Which PCM Bit Depth to use? [16/24/32 - default is 24]: " + read pcmbd[i] + case "${pcmbd[i]}" in + 16) acdc[i]="pcm_s16le"; abtrmeta[i]="(16 bit)" ;; + 24|"") acdc[i]="pcm_s24le"; abtrmeta[i]="(24 bit)" ;; + 32) acdc[i]="pcm_s32le"; abtrmeta[i]="(32 bit)" ;; + *) + error "-> Unsupported PCM Bit Depth!" + exit 1 + ;; + esac + ;; + esac + + case "${acodec[i]}" in + ac3|eac3|dts|aac|fdk*|mp3|vorbis|opus|"") + printf "Track $i: Specify the Audio Bitrate in kbps [${abropts[i]} - default is ${abrdef[i]}]: " + read abr[i] + test -z "${abr[i]}" && abitrate[i]="${abrdef[i]}k" || abitrate[i]="${abr[i]}k" + audbtr[i]="-b:a:${audmapval[i]} ${abitrate[i]}" + abtrmeta[i]="@ $(echo "${abitrate[i]}" | sed 's|k||') kbps" + ;; + esac case "${acodec[i]}" in ac3|eac3|dts|"") chanrange[i]="1-6"; defchan[i]="6" ;; @@ -1186,6 +1288,7 @@ 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]}" @@ -1405,11 +1508,65 @@ test ! -z "${afilters[i]}" && audfilters[i]="-filter:a:${audmapval[i]} ${afilters[i]}" fi - audparams[i]="${audmap[i]} -c:a:${audmapval[i]} ${acdc[i]} ${audprofile[i]} ${audbtr[i]} ${audchan[i]} ${audfilters[i]} ${audlang[i]} ${audmeta[i]}" + audparams[i]="${audmap[i]} -c:a:${audmapval[i]} ${acdc[i]} ${audprofile[i]} ${audcomplevel[i]} ${audbtr[i]} ${audchan[i]} ${audfilters[i]} ${audlang[i]} ${audmeta[i]}" fi done +if [ ! -z "$extracon" ]; then + formats_url="https://en.wikipedia.org/wiki/Comparison_of_video_container_formats#Formats_supported" + for i in $extracon; do + case "$i" in + # MKV is missing from the list since it supports + # all the supported audio codecs by the script + mp4) + for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do + case "${acodec[a]}" in + pcm|opus|flac) + error "-> Additional container $i does not support ${acodec[a]} audio!" + error "-> See: $formats_url" + exit 1 + ;; + esac + done + ;; + mov) + for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do + case "${acodec[a]}" in + pcm|opus) + error "-> Additional container $i does not support ${acodec[a]} audio!" + error "-> See: $formats_url" + exit 1 + ;; + esac + done + ;; + m4v) + for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do + case "${acodec[a]}" in + eac3|dts|vorbis|flac|pcm|opus) + error "-> Additional container $i does not support ${acodec[a]} audio!" + error "-> See: $formats_url" + exit 1 + ;; + esac + done + ;; + avi) + for a in $(eval echo "{1..$MAX_AUD_TRACKS}"); do + case "${acodec[a]}" in + opus) + error "-> Additional container $i does not support ${acodec[a]} audio!" + error "-> See: $formats_url" + exit 1 + ;; + esac + done + ;; + esac + done +fi + if [ ! -z "$skipsetpts" ]; then echo error "-> FPS conversion with the 'setpts' and 'atempo' filters has" @@ -1494,7 +1651,7 @@ case "$mode" in 1p) pass="1-pass" ;; 2p) pass="2-pass" ;; - *|"") pass="CRF"; mode="crf" ;; + crf|"") pass="CRF"; mode="crf" ;; esac echo @@ -1510,7 +1667,7 @@ case "$1" in 1p|crf) test "$mode" = "1p" && pmode="bitrate=$vbitrate" || pmode="crf=$CRF" - OPTS1="-map 0:0 -disposition:v:0 default $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + OPTS1="-map 0:0 -disposition:v:0 default $ofps $annexb $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" OPTS2="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subdis[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; 2p) @@ -1518,7 +1675,7 @@ passtwo="stats=\"$OUTFILE.log\":pass=2:bitrate=$vbitrate" OPTS1="-map 0:0" OPTS2="-an -f null -y /dev/null" - OPTS3="-map 0:0 -disposition:v:0 default $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" + OPTS3="-map 0:0 -disposition:v:0 default $ofps $annexb $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" OPTS4="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subdis[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; esac @@ -1535,6 +1692,15 @@ echo "" >> "$OUTFILE.sh" encoder_func $mode >> "$OUTFILE.sh" echo "" >> "$OUTFILE.sh" +if [ ! -z "$extracon" ]; then + for i in $extracon; do + case "$i" in + avi) echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy -bsf:v h264_mp4toannexb \"${OUTPUT%.*}.$i\"" >> "$OUTFILE.sh" ;; + *) echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy \"${OUTPUT%.*}.$i\"" >> "$OUTFILE.sh" ;; + esac + echo "" >> "$OUTFILE.sh" + done +fi chmod +x "$OUTFILE.sh" source "$OUTFILE.sh"
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
.