Projects
Multimedia
ffhevc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 17
View file
ffhevc.changes
Changed
@@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Mon Nov 14 09:18:00 UTC 2016 - neutrino8@opensuse.org + +- Update to version 3.0.1 + * Set default amount of subtitles to 1 instead of exiting when no + value is given + * Allow the user to choose the amount of audio tracks he wants at + run time instead of requiring it to be set in the config file. + This removes config file var MAX_AUD_TRACKS and bumps up version + to 31 + * Renamed array variables audmapval and submapval to audindex and + subindex since we're not mapping but specifying the audio/sub + index id with these vars + * Fixed a possible case where audio params weren't cleared in + case the nosound option was chosen + * Removed an if conditional checking for MAX_SUBS which no longer + is used + +------------------------------------------------------------------- Sun Nov 13 11:36:00 UTC 2016 - neutrino8@opensuse.org - Update to version 3.0.0
View file
ffhevc.spec
Changed
@@ -17,7 +17,7 @@ Name: ffhevc -Version: 3.0.0 +Version: 3.0.1 Release: 0 Summary: A small shell script for encoding to H.265/HEVC with ffmpeg License: GPL-2.0+
View file
ffhevc-3.0.0.tar.gz/ChangeLog -> ffhevc-3.0.1.tar.gz/ChangeLog
Changed
@@ -1,3 +1,18 @@ +2016-11-14 - ffhevc 3.0.1 + * Set default amount of subtitles to 1 instead of exiting when no + value is given + * Allow the user to choose the amount of audio tracks he wants at + run time instead of requiring it to be set in the config file. + This removes config file var MAX_AUD_TRACKS and bumps up version + to 31 + * Renamed array variables audmapval and submapval to audindex and + subindex since we're not mapping but specifying the audio/sub + index id with these vars + * Fixed a possible case where audio params weren't cleared in + case the nosound option was chosen + * Removed an if conditional checking for MAX_SUBS which no longer + is used + 2016-11-13 - ffhevc 3.0.0 * Added support for batch encoding mode, to be activated with the new -b option. It's used to encode directories with video files
View file
ffhevc-3.0.0.tar.gz/ffhevc -> ffhevc-3.0.1.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.0.0 -# Date: 2016-11-13 +# Version: 3.0.1 +# Date: 2016-11-14 # # ffhevc is free software ; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,10 +23,10 @@ brown() { echo -e "\e[0;33m$1\e[0;39;49m"; } error() { echo -e "\e[1;31m$1\e[0;39;49m"; } -version="3.0.0" +version="3.0.1" CFG="$HOME/.ffhevc" -cfgversion="30" +cfgversion="31" genconfig_func() { cat<<EOF>>"$CFG" @@ -90,12 +90,6 @@ AUD_VOLUME="y" AUD_RESAMPLE="y" -# Max amount of audio tracks to support -# Any non-zero value will do. Set it -# to "auto" to ask for as many as -# detected audio tracks -MAX_AUD_TRACKS="2" - # Enable subtitles support? # Note: not all containers support # all types of subs! @@ -253,31 +247,11 @@ esac done -if [ ! -z "$PRSTFILE" ]; then - if [ ! -z "$vpreset" -o ! -z "$vtune" ]; then - if [ ! -z "$(grep '^X265PARAMS' "$PRSTFILE")" ]; then - echo - error "-> x265 presets/tune profiles are mutually exclusive with custom presets!" - echo - error "-> If you want to use a custom configuration file, don't add or comment" - error " out the X265PARAMS variable in it. Then you can use the built-in" - error " presets/tuning with that file." - echo - exit 1 - fi - fi -else +if [ ! -z "$vtune" ]; then if [ -z "$vpreset" ]; then - if [ -f "$CFG" -a -z "$(grep '^X265PARAMS' "$CFG")" ]; then - echo - error "-> The X265PARAMS variable is commented out" - error " or missing from '$CFG'" - echo - error "-> Regenerating config file!" - rm -f "$CFG" - genconfig_func - echo - fi + error "-> Tune profiles require a preset to be used!" + error "-> Use: $(basename $0) -h" + exit 1 fi fi @@ -314,7 +288,37 @@ source "$CFG" fi -test ! -z "$PRSTFILE" && source "$PRSTFILE" +if [ ! -z "$PRSTFILE" ]; then + if [ ! -z "$vpreset" ]; then + if [ ! -z "$(grep '^X265PARAMS' "$PRSTFILE")" ]; then + error "-> x265 presets/tune profiles are mutually exclusive with custom presets!" + error "-> If you want to use a custom configuration file, don't add or comment" + error " out the X265PARAMS variable in it. Then you can use the built-in" + error " presets/tuning with that file." + echo + exit 1 + fi + else + if [ -z "$(grep '^X265PARAMS' "$PRSTFILE")" ]; then + error "-> The X265PARAMS variable is commented out or missing in your file!" + error "-> Please at least add to the file: X265PARAMS=\"ref=4\" (for example)" + echo + exit 1 + fi + fi + source "$PRSTFILE" +else + if [ -z "$vpreset" ]; then + if [ -f "$CFG" -a -z "$(grep '^X265PARAMS' "$CFG")" ]; then + error "-> The X265PARAMS variable is commented out" + error " or missing in '$CFG'" + error "-> Regenerating config file!" + echo + rm -f "$CFG" + genconfig_func + fi + fi +fi if [ ! -z "$FFMPEG" ]; then if [ ! -x "$FFMPEG" ]; then @@ -1058,36 +1062,40 @@ video_subtitles_func() { case "$1" in infile) - printf "How many Subtitles to Copy?: " + printf "How many Subtitles to Copy? [0-inf - default is 1]: " read subcp case "$subcp" in + 0) SUBCP="0" ;; [1-9]*) SUBCP="$subcp" ;; - ""|*) - error "-> Invalid or no value given!" + "") SUBCP="1" ;; + *) + error "-> Invalid value!" exit 1 ;; esac - for i in $(eval echo "{1..$SUBCP}"); do - submapval[i]="$(($i-1))" - printf "Sub $i: Specify a Subtitle to Copy [example: 0:2]: " - read subnr[i] - if [ ! -z "${subnr[i]}" ]; then - printf "Sub $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " - read slang[i] - if [ ! -z "${slang[i]}" ]; then - sublang[i]="-metadata:s:s:${submapval[i]} language=${slang[i]}" + if [ "$SUBCP" != "0" ]; then + for i in $(eval echo "{1..$SUBCP}"); do + subindex[i]="$(($i-1))" + printf "Sub $i: Specify a Subtitle to Copy [example: 0:2]: " + read subnr[i] + if [ ! -z "${subnr[i]}" ]; then + printf "Sub $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " + read slang[i] + if [ ! -z "${slang[i]}" ]; then + sublang[i]="-metadata:s:s:${subindex[i]} language=${slang[i]}" + fi + subcopy[i]="-map ${subnr[i]} -c:s:${subindex[i]} copy ${sublang[i]}" + # Workaround for an ffmpeg disposition issue + # where in some cases it sets subsequent tracks + # as default. + test "$i" = "1" && sdis="default" || sdis="none" + subdis[i]="-disposition:s:${subindex[i]} $sdis" + else + error "-> No value given!" + exit 1 fi - subcopy[i]="-map ${subnr[i]} -c:s:${submapval[i]} copy ${sublang[i]}" - # Workaround for an ffmpeg disposition issue - # where in some cases it sets subsequent tracks - # as default. - test "$i" = "1" && sdis="default" || sdis="none" - subdis[i]="-disposition:s:${submapval[i]} $sdis" - else - error "-> No value given!" - exit 1 - fi - done + done + fi test "$subopt" = "2" && echo ;; ext) @@ -1114,38 +1122,42 @@ esac done fi - printf "How many External Subtitles to Add?: " + printf "How many External Subtitles to Add? [0-inf - default is 1]: " read subext case "$subext" in + 0) SUBEXT="0" ;; [1-9]*) SUBEXT="$subext" ;; - ""|*) - error "-> Invalid or no value given!" + "") SUBEXT="1" ;; + *) + error "-> Invalid value!" exit 1 ;; esac - for i in $(eval echo "{1..$SUBEXT}"); do - test ! -z "${submapval[*]}" && submap[i]="$((${submapval[-1]}+$i))" || submap[i]="$(($i-1))" - printf "Sub $i: Specify the Subtitle File: " - read -e sub[i] - if [ ! -f "${sub[i]}" ]; then - error "-> No such file!" - exit 1 - else - printf "Sub $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " - read slng[i] - if [ ! -z "${slng[i]}" ]; then - sublng[i]="-metadata:s:s:${submap[i]} language=${slng[i]}" - fi - EXTSUBS[i]="-i \"${sub[i]}\"" - if [ ! -z "${submapval[*]}" ]; then - sdispo="none" + if [ "$SUBEXT" != "0" ]; then + for i in $(eval echo "{1..$SUBEXT}"); do + test ! -z "${subindex[*]}" && subidx[i]="$((${subindex[-1]}+$i))" || subidx[i]="$(($i-1))" + printf "Sub $i: Specify the Subtitle File: " + read -e subfile[i] + if [ ! -f "${subfile[i]}" ]; then + error "-> No such file!" + exit 1 else - test "$i" = "1" && sdispo="default" || sdispo="none" + printf "Sub $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " + read slng[i] + if [ ! -z "${slng[i]}" ]; then + sublng[i]="-metadata:s:s:${subidx[i]} language=${slng[i]}" + fi + EXTSUBS[i]="-i \"${subfile[i]}\"" + if [ ! -z "${subindex[*]}" ]; then + sdispo="none" + else + test "$i" = "1" && sdispo="default" || sdispo="none" + fi + subdispo[i]="-disposition:s:${subidx[i]} $sdispo" + subcpy[i]="-map $i:0 -c:s:${subidx[i]} copy ${sublng[i]}" fi - subdispo[i]="-disposition:s:${submap[i]} $sdispo" - subcpy[i]="-map $i:0 -c:s:${submap[i]} copy ${sublng[i]}" - fi - done + done + fi ;; esac } @@ -1166,12 +1178,6 @@ error "-> Could not detect any subtitles!" fi echo - if [ "$MAX_SUBS" = "auto" ]; then - error "-> Note: MAX_SUBS variable is set to \"auto\" in the config file!" - error "-> This means it will ask for as many as detected subtitle tracks" - error " and you cannot skip them!" - echo - fi brown " Subtitles" brown " ~~~~~~~~~" echo " 0 -> Copy subtitles from the input file" @@ -1207,42 +1213,41 @@ sleep 1 AUDTRKS="$($FFPROBE -i "$input" 2>&1 | grep 'Stream #' | grep 'Audio' | sed 's| ||g')" if [ ! -z "$AUDTRKS" ]; then - green "$AUDTRKS" ATRKS="$(echo "$AUDTRKS" | wc -l)" + green "$AUDTRKS" + echo + green "-> Detected $ATRKS audio tracks" else error "-> Could not detect any audio tracks!" - ATRKS="0" fi echo -if [ "$MAX_AUD_TRACKS" = "auto" ]; then - test "$ATRKS" = "0" && MAX_AUD_TRACKS="1" || MAX_AUD_TRACKS="$ATRKS" -fi +printf "How many Audio Tracks to Encode or Copy? [0-inf - default is 1]: " +read atracks +case "$atracks" in + 0) audparams[1]="-an"; ATRACKS="0" ;; + [1-9]*) ATRACKS="$atracks" ;; + "") ATRACKS="1" ;; + *) + error "-> Invalid value!" + exit 1 + ;; +esac -for i in $(eval echo "{1..$MAX_AUD_TRACKS}"); do - audmapval[i]="$(($i-1))" - if [ "$i" = "1" -a "$ATRKS" != "0" ]; then - defaudtrk="default is 0:1" - else - defaudtrk="press 'Enter' to skip" - fi - printf "Track $i: Specify the Audio Track to Encode or Copy [$defaudtrk]: " - read astream[i] - if [ -z "${astream[1]}" -a "$ATRKS" != "0" ]; then - astream[1]="0:1" - fi - if [ ! -z "${astream[i]}" ]; then +if [ "$ATRACKS" != "0" ]; then + 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]}" printf "Track $i: Specify the 3-letter Language Code for Metadata [press 'Enter' to skip]: " read alang[i] if [ ! -z "${alang[i]}" ]; then - audlang[i]="-metadata:s:a:${audmapval[i]} language=${alang[i]}" + audlang[i]="-metadata:s:a:${audindex[i]} language=${alang[i]}" fi - fi -done - -test -z "$(echo "${astream[*]}" | sed 's| ||g')" && audparams[1]="-an" - -if [ "${audparams[1]}" != "-an" ]; then + audmap[i]="-map ${atrack[i]}" + done + echo brown " Available Audio Codecs" brown " ~~~~~~~~~~~~~~~~~~~~~~" @@ -1259,18 +1264,14 @@ echo " PCM -----> Channels Support: 8 (ffmpeg max)" echo " COPY ----> Channels Support: depends on audio codec" echo " NOSOUND -> Channels Support: N/A" -fi - -for i in $(eval echo "{1..$MAX_AUD_TRACKS}"); do - if [ ! -z "${astream[i]}" ]; then + + for i in $(eval echo "{1..$ATRACKS}"); do echo - audmap[i]="-map ${astream[i]}" - # Workaround for an ffmpeg disposition issue # where in some cases it flags subsequent # tracks as default. test "$i" = "1" && adis="default" || adis="none" - auddis[i]="-disposition:a:${audmapval[i]} $adis" + auddis[i]="-disposition:a:${audindex[i]} $adis" printf "Track $i: Specify the Audio Codec [default is AC3]: " read acodec[i] @@ -1361,16 +1362,16 @@ fi ;; nosound) - audparams[1]="-an" - abitrate[1]="0" # nosound takes precedence so # clear any audio options given - if [ $i -ge 2 ]; then - for t in $(eval echo "{2..$MAX_AUD_TRACKS}"); do - audparams[t]= - auddis[t]= - done - fi + for t in $(eval echo "{1..$ATRACKS}"); do + audparams[t]= + auddis[t]= + done + echo + error "-> NOSOUND chosen. Clearing all other audio options!" + audparams[1]="-an" + abitrate[1]="0" break ;; *) @@ -1380,10 +1381,11 @@ esac conerror_func() { + test -z "${acodec[i]}" && audcodec[i]="ac3" || audcodec[i]="${acodec[i]}" if [ ! -z "$extracon" ]; then - error "-> Additional container $c does not support ${acodec[i]} audio!" + error "-> Additional container $c does not support ${audcodec[i]} audio!" else - error "-> The $c container does not support ${acodec[i]} audio!" + error "-> The $c container does not support ${audcodec[i]} audio!" error "-> Check your config file, if needed, in '$CFG'" fi error "-> See: https://en.wikipedia.org/wiki/Comparison_of_video_container_formats" @@ -1421,13 +1423,13 @@ exit 1 ;; esac - audprofile[i]="-profile:a:${audmapval[i]} ${aacprof[i]} -afterburner:a:${audmapval[i]} 1" + audprofile[i]="-profile:a:${audindex[i]} ${aacprof[i]} -afterburner:a:${audindex[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]}" + audcomplevel[i]="-compression_level:a:${audindex[i]} ${acomplevel[i]}" abtrmeta[i]="@ CL ${acomplevel[i]}" ;; pcm) @@ -1450,7 +1452,7 @@ 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]}" + audbtr[i]="-b:a:${audindex[i]} ${abitrate[i]}" abtrmeta[i]="@ $(echo "${abitrate[i]}" | sed 's|k||') kbps" ;; esac @@ -1542,8 +1544,8 @@ ;; esac - audmeta[i]="-metadata:s:a:${audmapval[i]} title=\"${ameta[i]} ${achmeta[i]} ${abtrmeta[i]}\"" - audchan[i]="-ac:a:${audmapval[i]} ${ach[i]} -channel_layout:a:${audmapval[i]} \"${chlayout[i]}\"" + audmeta[i]="-metadata:s:a:${audindex[i]} title=\"${ameta[i]} ${achmeta[i]} ${abtrmeta[i]}\"" + audchan[i]="-ac:a:${audindex[i]} ${ach[i]} -channel_layout:a:${audindex[i]} \"${chlayout[i]}\"" if [ "$AUD_NORMALIZE" = "y" ]; then printf "Track $i: Normalize the Audio Volume? [y/N]: " @@ -1571,7 +1573,7 @@ echo green "-> Track $i: detecting audio sample rate..." sleep 1 - aid[i]="$(($(echo "${astream[i]}" | awk -F: '{print $2}')-1))" + aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" ASR[i]="$($FFPROBE -i "$input" -show_streams -select_streams a:${aid[i]} 2>&1 | sed -n 's|^sample_rate=||p')" if [ ! -z "${ASR[i]}" ]; then green "-> Track $i: detected ${ASR[i]} Hz" @@ -1757,13 +1759,12 @@ afilters[i]="$(echo "${aresample[i]}${anormalize[i]}${avolume[i]}$atempo" | sed 's|,$||')" - test ! -z "${afilters[i]}" && audfilters[i]="-filter:a:${audmapval[i]} ${afilters[i]}" - + test ! -z "${afilters[i]}" && audfilters[i]="-filter:a:${audindex[i]} ${afilters[i]}" fi - 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 + audparams[i]="${audmap[i]} -c:a:${audindex[i]} ${acdc[i]} ${audprofile[i]} ${audcomplevel[i]} ${audbtr[i]} ${audchan[i]} ${audfilters[i]} ${audlang[i]} ${audmeta[i]}" + done +fi if [ ! -z "$skipsetpts" ]; then echo @@ -1796,9 +1797,9 @@ error "-> Skipping bitrate calculation!" else # Audio copy, get bitrate - for i in $(eval echo "{1..$MAX_AUD_TRACKS}"); do + for i in $(eval echo "{1..$ATRACKS}"); do if [ "${acodec[i]}" = "copy" ]; then - aid[i]="$(($(echo "${astream[i]}" | awk -F: '{print $2}')-1))" + aid[i]="$(($(echo "${atrack[i]}" | awk -F: '{print $2}')-1))" abtr[i]="$($FFPROBE -i "$input" -show_streams -select_streams a:${aid[i]} 2>&1 | sed -n 's|^bit_rate=||p')" case "${abtr[i]}" in [1-9]*) abitrate[i]="$((${abtr[i]}/1000))" ;; @@ -1822,18 +1823,6 @@ ;; esac -test "$METADATA" = "n" && MDATA="-map_metadata -1" - -test "$CHAPS" = "n" && CHPS="-map_chapters -1" - -vidfilters="$(echo "$deinterlace$crop$deblock$denoise$scale$rotate$setpts$fps" | sed 's|,$||')" - -test ! -z "$vidfilters" && vfilters="-vf $vidfilters" - -test ! -z "$vpreset" && X265PARAMS="$colorprim$interlaced $vpreset" || X265PARAMS=":$X265PARAMS$colorprim" - -test ! -z "$COMMENT" && METACOMMENT="-metadata comment=\"$COMMENT\"" - # Small counter :) counter_func() { for i in 5 4 3 2 1 0; do @@ -1866,12 +1855,24 @@ color_func normal && echo if [ -z "$batchmode" ]; then - OUTFILE="$(dirname "$OUTPUT")/$(basename "${OUTPUT%.*}" | sed 's| |_|g')" + OUTFILE="$(dirname "$OUTPUT")/$(basename "${OUTPUT%.*}" | sed 's| |_|g').sh" else - OUTFILE="$(dirname "$OUTPUT")/$(basename $0)_batch$$" + OUTFILE="$(dirname "$OUTPUT")/$(basename $0)_batch$$.sh" input="\$i" fi +test "$METADATA" = "n" && MDATA="-map_metadata -1" + +test "$CHAPS" = "n" && CHPS="-map_chapters -1" + +vidfilters="$(echo "$deinterlace$crop$deblock$denoise$scale$rotate$setpts$fps" | sed 's|,$||')" + +test ! -z "$vidfilters" && vfilters="-vf $vidfilters" + +test ! -z "$vpreset" && X265PARAMS="$colorprim$interlaced $vpreset $vtune" || X265PARAMS=":$X265PARAMS$colorprim" + +test ! -z "$COMMENT" && METACOMMENT="-metadata comment=\"$COMMENT\"" + encoder_func() { case "$1" in 1p|crf) @@ -1880,50 +1881,50 @@ OPTS2="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subcpy[*]} ${subdis[*]} ${subdispo[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; 2p) - passone="stats=\"$OUTFILE.log\":pass=1:bitrate=$vbitrate" - passtwo="stats=\"$OUTFILE.log\":pass=2:bitrate=$vbitrate" + passone="stats=\"${OUTFILE%.*}.log\":pass=1:bitrate=$vbitrate" + passtwo="stats=\"${OUTFILE%.*}.log\":pass=2:bitrate=$vbitrate" OPTS1="-map 0:0" OPTS2="-an -f null -y /dev/null" OPTS3="${EXTSUBS[*]} -map 0:0 -disposition:v:0 default $ofps $NOSUBS $MDATA $CHPS $METATITLE $METAGENRE $METAYEAR $METACOMMENT $vfilters $sws" OPTS4="${audparams[*]} ${auddis[*]} ${subcopy[*]} ${subcpy[*]} ${subdis[*]} ${subdispo[*]} $strict $movflags $METACOVER \"$OUTPUT\"" ;; esac - echo "nice -n $NICE $FFMPEG -i \"$input\" $OPTS1 -c:v libx265 -x265-params $pmode$passone$X265PARAMS $vtune $OPTS2" + echo "nice -n $NICE $FFMPEG -i \"$input\" $OPTS1 -c:v libx265 -x265-params $pmode$passone$X265PARAMS $OPTS2" case "$1" in 2p) echo - echo "nice -n $NICE $FFMPEG -i \"$input\" $OPTS3 -c:v libx265 -x265-params $passtwo$X265PARAMS $vtune $OPTS4" + echo "nice -n $NICE $FFMPEG -i \"$input\" $OPTS3 -c:v libx265 -x265-params $passtwo$X265PARAMS $OPTS4" ;; esac } -echo "#!/usr/bin/env bash" > "$OUTFILE.sh" -echo "" >> "$OUTFILE.sh" +echo "#!/usr/bin/env bash" > "$OUTFILE" +echo "" >> "$OUTFILE" if [ ! -z "$batchmode" ]; then - echo "$CHDIR" >> "$OUTFILE.sh" - echo "" >> "$OUTFILE.sh" - echo "$FORLOOP_START" >> "$OUTFILE.sh" - echo "$CHKFILE_START" >> "$OUTFILE.sh" + echo "$CHDIR" >> "$OUTFILE" + echo "" >> "$OUTFILE" + echo "$FORLOOP_START" >> "$OUTFILE" + echo "$CHKFILE_START" >> "$OUTFILE" fi -encoder_func $encmode >> "$OUTFILE.sh" -echo "" >> "$OUTFILE.sh" +encoder_func $encmode >> "$OUTFILE" +echo "" >> "$OUTFILE" if [ ! -z "$extracon" ]; then - echo "grn() { echo -e \"\e[1;32m\$1\e[0;39;49m\"; }" >> "$OUTFILE.sh" - echo "red() { echo -e \"\e[1;31m\$1\e[0;39;49m\"; }" >> "$OUTFILE.sh" + echo "green() { echo -e \"\e[1;32m\$1\e[0;39;49m\"; }" >> "$OUTFILE" + echo "red() { echo -e \"\e[1;31m\$1\e[0;39;49m\"; }" >> "$OUTFILE" for i in $extracon; do - echo "" >> "$OUTFILE.sh" - echo "echo" >> "$OUTFILE.sh" - echo "grn \"-> Converting to $i...\"" >> "$OUTFILE.sh" - echo "" >> "$OUTFILE.sh" - echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE.sh" - echo "test \"\$?\" = \"0\" && grn \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE.sh" + echo "" >> "$OUTFILE" + echo "echo" >> "$OUTFILE" + echo "green \"-> Remuxing to $i...\"" >> "$OUTFILE" + echo "" >> "$OUTFILE" + echo "$FFMPEG -i \"$OUTPUT\" -map 0 -c copy \"${OUTPUT%.*}.$i\" >/dev/null 2>&1" >> "$OUTFILE" + echo "test \"\$?\" = \"0\" && green \"-> Done\" || red \"-> Failed!\"" >> "$OUTFILE" done - echo "echo" >> "$OUTFILE.sh" + echo "echo" >> "$OUTFILE" fi if [ ! -z "$batchmode" ]; then - echo "$CHKFILE_END" >> "$OUTFILE.sh" - echo "$FORLOOP_END" >> "$OUTFILE.sh" + echo "$CHKFILE_END" >> "$OUTFILE" + echo "$FORLOOP_END" >> "$OUTFILE" fi -chmod +x "$OUTFILE.sh" +chmod +x "$OUTFILE" -source "$OUTFILE.sh" +source "$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
.