Projects
Multimedia
h264enc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 375
View file
h264enc.spec
Changed
@@ -1,7 +1,7 @@ # norootforbuild Name: h264enc -Version: 10.2.9 +Version: 10.3.0 Release: 1 License: GPL-2.0+ @@ -58,6 +58,13 @@ %changelog +* Mon Sep 29 2014 Grozdan Nikolov <neutrino8@gmail.com> 10.3.0 + * Get rid of the $RATIO var in the ratio_and_pixels_func() function + * Support disabling of all video filters at once through the config file + * Support disabling of cropping and subtitles + * Support disabling of all audio filters at once + * Support disabling of asking for DVD/BD angles and chapters encode + * Sat Sep 27 2014 Grozdan Nikolov <neutrino8@gmail.com> 10.2.9 * Colorize the output of detected subtitles and DVD/VCD titles * Merge the two case statements of the ratio_and_pixels_func() function
View file
h264enc-10.2.9.tar.gz/doc/ChangeLog -> h264enc-10.3.0.tar.gz/doc/ChangeLog
Changed
@@ -1,3 +1,10 @@ +2014-09-29- h264enc 10.3.0 + * Get rid of the $RATIO var in the ratio_and_pixels_func() function + * Support disabling of all video filters at once through the config file + * Support disabling of cropping and subtitles + * Support disabling of all audio filters at once + * Support disabling of asking for DVD/BD angles and chapters encode + 2014-09-27 - h264enc 10.2.9 * Colorize the output of detected subtitles and DVD/VCD titles * Merge the two case statements of the ratio_and_pixels_func() function
View file
h264enc-10.2.9.tar.gz/h264enc -> h264enc-10.3.0.tar.gz/h264enc
Changed
@@ -1,5 +1,5 @@ #!/usr/bin/env bash -# $Id: h264enc, v 10.2.9, 2014/09/27, gn Exp $ +# $Id: h264enc, v 10.3.0, 2014/09/29, gn Exp $ # # Encode BDs/DVDs/VCDs/video files to the H.264/AVC/MPEG-4 Part 10 # video format using MEncoder from MPlayer @@ -23,8 +23,8 @@ shopt -u expand_aliases export PATH=$PATH:/usr/local/bin -version=10.2.9 -configversion=32 +version=10.3.0 +configversion=33 green() { echo -e "\e[1;32m$1\e[0;39;49m"; } @@ -134,6 +134,19 @@ # For use with the -e option EDITOR="nano" +# If one or more of the below +# variables is set to "y", it +# disables the specific function +DISABLE_ALL_VID_FILTERS="n" +DISABLE_VID_CROP_FILTER="n" +DISABLE_SUBTITLES="n" +DISABLE_ALL_AUD_FILTERS="n" + +DISABLE_ASK_DVD_ANGLE="n" +DISABLE_ASK_DVD_CHAPTERS="n" +DISABLE_ASK_BD_ANGLE="n" +DISABLE_ASK_BD_CHAPTERS="n" + # Video filters ALLOW_VID_DEINTERLACE="y" ALLOW_VID_INTERLACE="y" @@ -3362,41 +3375,56 @@ } video_filters_func() { - if [ "$vfilters" = "y" ]; then - echo - brown "+==================================+" - brown "| Pre/Postprocessing Video Filters |" - brown "+==================================+" - echo - test "$ALLOW_VID_DEINTERLACE" = "y" && video_deinterlace_func - test "$ALLOW_VID_INTERLACE" = "y" && video_interlace_func - test "$ALLOW_VID_DEBLOCK" = "y" && video_deblock_func - test "$ALLOW_VID_DELOGO" = "y" && video_delogo_func - test "$ALLOW_VID_DENOISE" = "y" && video_denoise_func - test "$ALLOW_VID_DEBAND" = "y" && video_deband_func - test "$ALLOW_VID_NOISE" = "y" && video_noise_func - test "$ALLOW_VID_UNSHARP" = "y" && video_unsharp_func - test "$ALLOW_VID_BRIGHTNESS" = "y" && video_brightness_func - test "$ALLOW_VID_EQUALIZER" = "y" && video_equalizer_func + if [ "$DISABLE_ALL_VID_FILTERS" = "n" ]; then + vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") + if [ "$vfilters" = "y" ]; then + echo + brown "+==================================+" + brown "| Pre/Postprocessing Video Filters |" + brown "+==================================+" + echo + test "$ALLOW_VID_DEINTERLACE" = "y" && video_deinterlace_func + test "$ALLOW_VID_INTERLACE" = "y" && video_interlace_func + test "$ALLOW_VID_DEBLOCK" = "y" && video_deblock_func + test "$ALLOW_VID_DELOGO" = "y" && video_delogo_func + test "$ALLOW_VID_DENOISE" = "y" && video_denoise_func + test "$ALLOW_VID_DEBAND" = "y" && video_deband_func + test "$ALLOW_VID_NOISE" = "y" && video_noise_func + test "$ALLOW_VID_UNSHARP" = "y" && video_unsharp_func + test "$ALLOW_VID_BRIGHTNESS" = "y" && video_brightness_func + test "$ALLOW_VID_EQUALIZER" = "y" && video_equalizer_func + else + interlaced=":nointerlaced" + fi else interlaced=":nointerlaced" fi - if [ "$ALLOW_VID_AUTOCROP" = "y" ]; then - # Skip autocropping for directory - # batch encoding mode - case "$source" in - file|dvd|vcd|bd) - video_crop_func - ;; - esac - else - cropping=$(get_selection_func "Would you like to Crop the $type? [y/N]: ") - if [ "$cropping" = "y" ]; then - video_crop_func + if [ "$DISABLE_VID_CROP_FILTER" = "n" ]; then + if [ "$ALLOW_VID_AUTOCROP" = "y" ]; then + # Skip autocropping for directory + # batch encoding mode + case "$source" in + file|dvd|vcd|bd) + video_crop_func + ;; + esac + else + cropping=$(get_selection_func "Would you like to Crop the $type? [y/N]: ") + if [ "$cropping" = "y" ]; then + video_crop_func + fi fi fi } +ask_video_subtitles_func() { + if [ "$DISABLE_SUBTITLES" = "n" ]; then + video_subtitles_func + else + true + fi +} + ############################################################# ############## BD/DVD/VCD/video file settings ############### @@ -3472,7 +3500,7 @@ if [ -x "$MKVEXTRACT" -o -x "$MP4BOX" ]; then case "${infile##*.}" in mkv|MKV|mp4|MP4|m4v|M4V) - dumpchaps=$(get_selection_func "Extract Chapters Info to a file? [y/N]: ") + dumpchaps=$(get_selection_func "Extract Chapters Info to a File? [y/N]: ") if [ "$dumpchaps" = "y" ]; then dump_chaps_info_func() { case "$1" in @@ -3525,9 +3553,8 @@ ;; esac fi - vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") video_filters_func - video_subtitles_func + ask_video_subtitles_func ;; dir) type="Video files" @@ -3567,9 +3594,8 @@ fi fi OUTPUT="$OUTPUTDIR/\${i%.*}.avi" - vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") video_filters_func - video_subtitles_func + ask_video_subtitles_func ;; bd) type="Blu-ray" @@ -3654,49 +3680,52 @@ else sourcetype="br://$title" fi - BDTITLE="$(echo $sourcetype | sed 's|br://||')" - angle=$(get_selection_func "Would you like to encode from a different $type Angle? [y/N]: ") - if [ "$angle" = "y" ]; then - echo - green "-> Scanning for angles in title $BDTITLE..." - $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/angles" - BDANGLE="$(grep "^ID_BLURAY_TITLE_${BDTITLE}_ANGLE" "$TEMPDIR/angles" | awk -F= '{print $2}')" - if [ ! -z "$BDANGLE" ]; then - green "-> Found $BDANGLE angles" - else - error "-> Could not detect any angles in this $type title!" - fi - rm -f "$TEMPDIR/angles" - echo - printf "From which Angle to encode the $type? [default is 1]: " - read bdangle - if [ ! -z "$bdangle" ]; then - movieangle="-bluray-angle $bdangle" - fi - fi - chap=$(get_selection_func "Would you like to encode only Specific Chapters? [y/N]: ") - if [ "$chap" = "y" ]; then - echo - green "-> Scanning for chapters in title $BDTITLE..." - $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/chapters" - BDCHAPS="$(grep "^ID_BLURAY_TITLE_${BDTITLE}_CHAPTERS" "$TEMPDIR/chapters" | awk -F= '{print $2}')" - if [ ! -z "$BDCHAPS" -a "$BDCHAPS" != "0" ]; then - green "-> Found $BDCHAPS chapters" - else - error "-> Could not detect any chapters in this $type title!" - fi - rm -f "$TEMPDIR/chapters" - chapters_example_func - printf "Which chapter(s) to encode from this $type title? [press 'Enter' to skip]: " - read chapenc - if [ ! -z "$chapenc" ]; then - chapters="-chapter $chapenc" + if [ "$DISABLE_ASK_BD_ANGLE" = "n" ]; then + BDTITLE="$(echo $sourcetype | sed 's|br://||')" + angle=$(get_selection_func "Would you like to encode from a Different $type Angle? [y/N]: ") + if [ "$angle" = "y" ]; then + echo + green "-> Scanning for angles in title $BDTITLE..." + $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/angles" + BDANGLE="$(grep "^ID_BLURAY_TITLE_${BDTITLE}_ANGLE" "$TEMPDIR/angles" | awk -F= '{print $2}')" + if [ ! -z "$BDANGLE" ]; then + green "-> Found $BDANGLE angles" + else + error "-> Could not detect any angles in this $type title!" + fi + rm -f "$TEMPDIR/angles" + echo + printf "From which Angle to encode the $type? [default is 1]: " + read bdangle + if [ ! -z "$bdangle" ]; then + movieangle="-bluray-angle $bdangle" + fi + fi + fi + if [ "$DISABLE_ASK_BD_CHAPTERS" = "n" ]; then + chap=$(get_selection_func "Would you like to Encode only Specific Chapters? [y/N]: ") + if [ "$chap" = "y" ]; then + echo + green "-> Scanning for chapters in title $BDTITLE..." + $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/chapters" + BDCHAPS="$(grep "^ID_BLURAY_TITLE_${BDTITLE}_CHAPTERS" "$TEMPDIR/chapters" | awk -F= '{print $2}')" + if [ ! -z "$BDCHAPS" -a "$BDCHAPS" != "0" ]; then + green "-> Found $BDCHAPS chapters" + else + error "-> Could not detect any chapters in this $type title!" + fi + rm -f "$TEMPDIR/chapters" + chapters_example_func + printf "Which chapter(s) to encode from this $type title? [press 'Enter' to skip]: " + read chapenc + if [ ! -z "$chapenc" ]; then + chapters="-chapter $chapenc" backup_file_func files + fi fi fi - vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") video_filters_func - video_subtitles_func + ask_video_subtitles_func #backup_file_func subs ;; dvd) @@ -3798,48 +3827,52 @@ else sourcetype="dvd://$title" fi - DTITLE="$(echo $sourcetype | sed 's|dvd://||')" - angle=$(get_selection_func "Would you like to encode from a different $type Angle? [y/N]: ") - if [ "$angle" = "y" ]; then - echo - green "-> Scanning for angles in title $DTITLE..." - ANGLES=$($MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null | grep "angles") - if [ ! -z "$ANGLES" ]; then - green "-> $ANGLES" - else - green "-> Could not detect any angles in this $type title!" - fi - echo - printf "From which Angle to encode the $type? [default is 1]: " - read dvd_angle - if [ ! -z "$dvd_angle" ]; then - movieangle="-dvdangle $dvd_angle" + if [ "$DISABLE_ASK_DVD_ANGLE" = "n" ]; then + DTITLE="$(echo $sourcetype | sed 's|dvd://||')" + angle=$(get_selection_func "Would you like to encode from a different $type Angle? [y/N]: ") + if [ "$angle" = "y" ]; then + echo + green "-> Scanning for angles in title $DTITLE..." + ANGLES=$($MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null | grep "angles") + if [ ! -z "$ANGLES" ]; then + green "-> $ANGLES" + else + error "-> Could not detect any angles in this $type title!" + fi + echo + printf "From which Angle to encode the $type? [default is 1]: " + read dvd_angle + if [ ! -z "$dvd_angle" ]; then + movieangle="-dvdangle $dvd_angle" + fi fi fi - chap=$(get_selection_func "Would you like to encode only Specific Chapters? [y/N]: ") - if [ "$chap" = "y" ]; then - echo - green "-> Scanning for chapters in title $DTITLE..." - $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/chapters" - echo - brown "Available Chapters On Disc" - brown "~~~~~~~~~~~~~~~~~~~~~~~~~~" - if [ ! -z "$(grep '^CHAPTERS' "$TEMPDIR/chapters")" ]; then - grep '^CHAPTERS' "$TEMPDIR/chapters" | sed 's|CHAPTERS: ||; s|,| |g' > "$TEMPDIR/getchaps" - for i in $(cat "$TEMPDIR/getchaps"); do - echo "Chapter: $i - Start position: " >> "$TEMPDIR/lschaps" - done - nl "$TEMPDIR/lschaps" | awk '{print $2,$1,$4,$5,$6,$3}' - else - green "-> Could not detect any chapters in this $type title!" - fi - rm -f "$TEMPDIR/*" - chapters_example_func - printf "Which chapter(s) to encode from this $type title? [press 'Enter' to skip]: " - read chapenc - if [ ! -z "$chapenc" ]; then - chapters="-chapter $chapenc" - backup_file_func files + if [ "$DISABLE_ASK_DVD_CHAPTERS" = "n" ]; then + chap=$(get_selection_func "Would you like to encode only Specific Chapters? [y/N]: ") + if [ "$chap" = "y" ]; then + echo + green "-> Scanning for chapters in title $DTITLE..." + $MPLAYER $sourcetype $MPLAYEROPTS $device $MPOPTS 2>/dev/null > "$TEMPDIR/chapters" + echo + brown "Available Chapters On Disc" + brown "~~~~~~~~~~~~~~~~~~~~~~~~~~" + if [ ! -z "$(grep '^CHAPTERS' "$TEMPDIR/chapters")" ]; then + grep '^CHAPTERS' "$TEMPDIR/chapters" | sed 's|CHAPTERS: ||; s|,| |g' > "$TEMPDIR/getchaps" + for i in $(cat "$TEMPDIR/getchaps"); do + echo "Chapter: $i - Start position: " >> "$TEMPDIR/lschaps" + done + nl "$TEMPDIR/lschaps" | awk '{print $2,$1,$4,$5,$6,$3}' + else + error "-> Could not detect any chapters in this $type title!" + fi + rm -f "$TEMPDIR/*" + chapters_example_func + printf "Which chapter(s) to encode from this $type title? [press 'Enter' to skip]: " + read chapenc + if [ ! -z "$chapenc" ]; then + chapters="-chapter $chapenc" + backup_file_func files + fi fi fi # Export chapters information to a file. @@ -3847,16 +3880,15 @@ # info when muxing into MKV/MP4/OGM. It # requires ogmtools' 'dvdxchap'. if [ -x "$DVDXCHAP" ]; then - chapexp=$(get_selection_func "Export $type chapters information to a file on disk? [y/N]: ") + chapexp=$(get_selection_func "Export $type Chapters Information to a File on Disk? [y/N]: ") if [ "$chapexp" = "y" ]; then CHAPTERSFILE="${OUTPUT%.*}.chaps" backup_file_func chaps $DVDXCHAP -t $(echo $sourcetype | sed 's|dvd://||') $(echo $device | awk '{print $2}') 2>/dev/null | grep '^CHAPTER' > "$CHAPTERSFILE" fi fi - vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") video_filters_func - video_subtitles_func + ask_video_subtitles_func backup_file_func subs ;; vcd) @@ -3886,9 +3918,8 @@ set_output_filename_func check_diskspace_func backup_file_func files - vfilters=$(get_selection_func "Would you like to use Pre/Postprocessing video filters? [y/N]: ") video_filters_func - video_subtitles_func + ask_video_subtitles_func ;; *|"") error "-> You have to specify the input type (file/dir/vcd/dvd/bd)" @@ -4191,111 +4222,112 @@ esac fi -# Pulldown reversal/inverse telecine/telecine -# 3:2 pulldown filters. Mutually exclusive with -# (frame doubling) deinterlacing filters and -# FPS conversion - -case "$GETFPS" in - 23.976|29.970|23.97|29.97|59.94|59.940|"") - if [ "$setfps" = "no" -a "$interlaced" = ":nointerlaced" -a -z "$deintfilter" -a -z "$frc" ]; then - tpp=$(get_selection_func "Apply a Telecine/3:2 Pulldown/IVTC/Pullup process? [y/N]: ") - if [ "$tpp" = "y" ]; then - echo - brown "Telecine/3:2 Pulldown/IVTC/Pullup" - brown "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - echo "0 -> Inverse Telecine: 29.970 -> 23.976 fps" - echo "1 -> Inverse Telecine: 59.940 -> 23.976 fps (filmdint/framestep)" - echo "2 -> Inverse Telecine: 59.940 -> 23.976 fps (tinterlace/filmdint)" - echo "3 -> Hard Telecine: 23.976 -> 29.970 fps" - echo "4 -> Skip the Telecine/Pullup process" - echo - printf "Which process to use? [default is 0]: " - read telproc - case "$telproc" in - 0|"") - echo - brown "Available IVTC Filters" - brown "~~~~~~~~~~~~~~~~~~~~~~" - echo "0 -> Pullup (4th generation IVTC filter)" - echo "1 -> Filmdint (3rd generation IVTC filter)" - echo "2 -> IVTC (2nd generation IVTC filter)" - echo "3 -> DETC (1st generation IVTC filter)" - echo - printf "Which Inverse Telecine/Pullup filter to use? [default is 1]: " - read ivtc - case "$ivtc" in - 0) ivtcfilter="pullup," ;; - 1|"") ivtcfilter="filmdint=fast=0," ;; - 2) ivtcfilter="ivtc=1," ;; - 3) +if [ "$DISABLE_ALL_VID_FILTERS" = "n" ]; then + # Pulldown reversal/inverse telecine/telecine + # 3:2 pulldown filters. Mutually exclusive with + # (frame doubling) deinterlacing filters and + # FPS conversion + case "$GETFPS" in + 23.976|29.970|23.97|29.97|59.94|59.940|"") + if [ "$setfps" = "no" -a "$interlaced" = ":nointerlaced" -a -z "$deintfilter" -a -z "$frc" ]; then + tpp=$(get_selection_func "Apply a Telecine/3:2 Pulldown/IVTC/Pullup process? [y/N]: ") + if [ "$tpp" = "y" ]; then + echo + brown "Telecine/3:2 Pulldown/IVTC/Pullup" + brown "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + echo "0 -> Inverse Telecine: 29.970 -> 23.976 fps" + echo "1 -> Inverse Telecine: 59.940 -> 23.976 fps (filmdint/framestep)" + echo "2 -> Inverse Telecine: 59.940 -> 23.976 fps (tinterlace/filmdint)" + echo "3 -> Hard Telecine: 23.976 -> 29.970 fps" + echo "4 -> Skip the Telecine/Pullup process" + echo + printf "Which process to use? [default is 0]: " + read telproc + case "$telproc" in + 0|"") echo - brown "DETC Frame Dropping Modes" - brown "~~~~~~~~~~~~~~~~~~~~~~~~~" - echo "0 -> Always drop a frame if there has been" - echo " no drops or telecine merges in past" - echo " 5 frames. (detc=dr=1)" - echo - echo "1 -> Always maintain exact 5:4 input to" - echo " output frame ratio. (detc=dr=2)" - echo - printf "Select a DETC frame dropping mode [default is 0]: " - read detcmode - case "$detcmode" in - 0|"") ivtcfilter="detc=dr=1," ;; - 1|*) ivtcfilter="detc=dr=2," ;; + brown "Available IVTC Filters" + brown "~~~~~~~~~~~~~~~~~~~~~~" + echo "0 -> Pullup (4th generation IVTC filter)" + echo "1 -> Filmdint (3rd generation IVTC filter)" + echo "2 -> IVTC (2nd generation IVTC filter)" + echo "3 -> DETC (1st generation IVTC filter)" + echo + printf "Which Inverse Telecine/Pullup filter to use? [default is 1]: " + read ivtc + case "$ivtc" in + 0) ivtcfilter="pullup," ;; + 1|"") ivtcfilter="filmdint=fast=0," ;; + 2) ivtcfilter="ivtc=1," ;; + 3) + echo + brown "DETC Frame Dropping Modes" + brown "~~~~~~~~~~~~~~~~~~~~~~~~~" + echo "0 -> Always drop a frame if there has been" + echo " no drops or telecine merges in past" + echo " 5 frames. (detc=dr=1)" + echo + echo "1 -> Always maintain exact 5:4 input to" + echo " output frame ratio. (detc=dr=2)" + echo + printf "Select a DETC frame dropping mode [default is 0]: " + read detcmode + case "$detcmode" in + 0|"") ivtcfilter="detc=dr=1," ;; + 1|*) ivtcfilter="detc=dr=2," ;; + esac + ;; + *) + error "-> Unknown IVTC option: '$ivtc'" + exit_func 1 + ;; esac + echo + green "-> Setting input/output frame rate to 29.970 / 23.976 FPS" + green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" + fps="-fps 30000/1001" + ofps="-ofps 24000/1001" + ;; + 1) + fps="-fps 60000/1001" + ofps="-ofps 24000/1001" + ivtcfilter="filmdint=fast=0,framestep=2," + echo + green "-> Setting input/output frame rate to 59.940 / 23.976 FPS" + green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" + ;; + 2) + fps="-fps 60000/1001" + ofps="-ofps 24000/1001" + ivtcfilter="tinterlace=4,filmdint=fast=0," + echo + green "-> Setting input/output frame rate to 59.940 / 23.976 FPS" + green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" + ;; + 3) + # Both fps and ofps *must* be + # 30000/1001 or we will lose + # A/V sync due to limitations + # in the filter layer of MEncoder + fps="-fps 30000/1001" + ofps="-ofps 30000/1001" + telecinefilter=",telecine" + interlaced=":interlaced:pic_struct" + echo + green "-> Setting input/output frame rate to 29.970 FPS" + green "-> Using '$(echo $telecinefilter | sed 's|^,||')' video filter(s)" ;; + 4) true ;; *) - error "-> Unknown IVTC option: '$ivtc'" + error "-> Unknown IVTC/Pulldown option: '$telproc'" exit_func 1 ;; esac - echo - green "-> Setting input/output frame rate to 29.970 / 23.976 FPS" - green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" - fps="-fps 30000/1001" - ofps="-ofps 24000/1001" - ;; - 1) - fps="-fps 60000/1001" - ofps="-ofps 24000/1001" - ivtcfilter="filmdint=fast=0,framestep=2," - echo - green "-> Setting input/output frame rate to 59.940 / 23.976 FPS" - green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" - ;; - 2) - fps="-fps 60000/1001" - ofps="-ofps 24000/1001" - ivtcfilter="tinterlace=4,filmdint=fast=0," - echo - green "-> Setting input/output frame rate to 59.940 / 23.976 FPS" - green "-> Using '$(echo $ivtcfilter | sed 's|,$||')' video filter(s)" - ;; - 3) - # Both fps and ofps *must* be - # 30000/1001 or we will lose - # A/V sync due to limitations - # in the filter layer of MEncoder - fps="-fps 30000/1001" - ofps="-ofps 30000/1001" - telecinefilter=",telecine" - interlaced=":interlaced:pic_struct" - echo - green "-> Setting input/output frame rate to 29.970 FPS" - green "-> Using '$(echo $telecinefilter | sed 's|^,||')' video filter(s)" - ;; - 4) true ;; - *) - error "-> Unknown IVTC/Pulldown option: '$telproc'" - exit_func 1 - ;; - esac + fi fi - fi - ;; -esac + ;; + esac +fi # Overwrite input/output frame rate if the # user has chosen to interlace his progressive @@ -4358,14 +4390,12 @@ cropped) VWIDTH="$(echo $cropfilter | sed 's|crop=||' | awk -F: '{print $1}')" VHEIGHT="$(echo $cropfilter | sed 's|crop=||' | awk -F: '{print $2}')" - RATIO="$VWIDTH/$VHEIGHT" PIXELS="$(($(echo "$GETRES" | sed 's|x|*|')))" - green "-> Detected Aspect Ratio (AR): $(echo "scale=4; $RATIO" | $BC -l | sed 's|^\.|0\.|'):1" + green "-> Detected Aspect Ratio (AR): $(echo "scale=4; $VWIDTH/$VHEIGHT" | $BC -l | sed 's|^\.|0\.|'):1" ;; scaled) VWIDTH="$(echo $scale | sed "s|${ilpack}scale=||" | awk -F: '{print $1}')" VHEIGHT="$(echo $scale | sed "s|${ilpack}scale=||" | awk -F: '{print $2}')" - RATIO="$VWIDTH/$VHEIGHT" PIXELS="$(($(echo $scale | sed "s|${ilpack}scale=||; s|:|*|")))" green "-> Aspect Ratio (AR): $(echo "scale=4; $VWIDTH/$VHEIGHT" | $BC -l | sed 's|^\.|0\.|'):1" ;; @@ -4402,18 +4432,22 @@ fi else error "-> Failed to detect the $restype resolution!" - error "-> You have to provide it yourself!" + if [ "$DISABLE_ALL_VID_FILTERS" = "n" ]; then + error "-> You have to provide it yourself!" + GETRES="??" + fi device_resolution_info_func $3 - GETRES="??" fi rm -f "$TEMPDIR/resolution" echo -printf "Specify the desired Resolution [default is $GETRES]: " -read vres -if [ -z "$vres" -a "$GETRES" = "??" ]; then - error "-> You have to specify the resolution!" - exit_func 1 +if [ "$DISABLE_ALL_VID_FILTERS" = "n" ]; then + printf "Specify the desired Resolution [default is $GETRES]: " + read vres + if [ -z "$vres" -a "$GETRES" = "??" ]; then + error "-> You have to specify the resolution!" + exit_func 1 + fi fi case "$vres" in @@ -4559,49 +4593,51 @@ ;; esac -if [ "$ALLOW_VID_DSIZE" = "y" ]; then - if [ ! -z "$scale" ]; then - printf "Specify the Display size/aspect [press 'Enter' to skip]: " - read dsize - if [ ! -z "$dsize" ]; then - dsizefilter="dsize=$dsize," +if [ "$DISABLE_ALL_VID_FILTERS" = "n" ]; then + if [ "$ALLOW_VID_DSIZE" = "y" ]; then + if [ ! -z "$scale" ]; then + printf "Specify the Display Size/Aspect [press 'Enter' to skip]: " + read dsize + if [ ! -z "$dsize" ]; then + dsizefilter="dsize=$dsize," + fi fi fi -fi -if [ "$ALLOW_VID_EXPAND" = "y" ]; then - printf "Specify the Expand filter parameters [press 'Enter' to skip]: " - read exp_param - if [ ! -z "$exp_param" ]; then - if [ ! -z "$scale" ]; then - printf "Place the filter before (b) or after (a) the scale filter? [b/a - default is a]: " - read expandpos - case "$expandpos" in - a|A|"") expandfilter_afr=",expand=$(echo "$exp_param" | tr '[:alpha:]' ':')" ;; + if [ "$ALLOW_VID_EXPAND" = "y" ]; then + printf "Specify the Expand filter parameters [press 'Enter' to skip]: " + read exp_param + if [ ! -z "$exp_param" ]; then + if [ ! -z "$scale" ]; then + printf "Place the filter before (b) or after (a) the scale filter? [b/a - default is a]: " + read expandpos + case "$expandpos" in + a|A|"") expandfilter_afr=",expand=$(echo "$exp_param" | tr '[:alpha:]' ':')" ;; *) expandfilter_bfr="expand=$(echo "$exp_param" | tr '[:alpha:]' ':')," ;; - esac - else + esac + else expandfilter_bfr="expand=$(echo "$exp_param" | tr '[:alpha:]' ':')," + fi fi fi -fi -# Do a colorspace conversion? -# Don't ask for this when using -# the portable device presets -if [ "$ALLOW_VID_COLORSPACE" = "y" ]; then - case "$3" in - bd40|bdhq40|bd41|bdhq41|avchd|avchdhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|ipc|ipchq|ip|iphq|iph|iphhq|psp|psphq|mz|mzhq) - true - ;; - *) - if [ ! -z "$scale" ]; then - if [ -z "$fpsfilter" -a -z "$intfilter" -a -z "$telecinefilter" -a "$interlaced" = ":nointerlaced" ]; then - video_colorspace_func + # Do a colorspace conversion? + # Don't ask for this when using + # the portable device presets + if [ "$ALLOW_VID_COLORSPACE" = "y" ]; then + case "$3" in + bd40|bdhq40|bd41|bdhq41|avchd|avchdhq|ar|arhq|ar5|ar5hq|bb|bbhq|nks60|nks60hq|ipc|ipchq|ip|iphq|iph|iphhq|psp|psphq|mz|mzhq) + true + ;; + *) + if [ ! -z "$scale" ]; then + if [ -z "$fpsfilter" -a -z "$intfilter" -a -z "$telecinefilter" -a "$interlaced" = ":nointerlaced" ]; then + video_colorspace_func + fi fi - fi - ;; - esac + ;; + esac + fi fi # Aspect ratio @@ -6102,33 +6138,40 @@ read decout[$i] case "${decout[$i]}" in o|O|0) - audio_channels_amount_func - if [ "${AACTYPE[$i]}" = "HE-AACv2" ]; then - if [ "$(echo ${channels[$i]} | awk '{print $2}')" != "2" ]; then - echo - error "-> HE-AACv2 only supports Stereo!" - error "-> Forcing stereo output decoding" - echo - channels[$i]="-channels 2" + if [ "$DISABLE_ALL_AUD_FILTERS" = "n" ]; then + audio_channels_amount_func + if [ "${AACTYPE[$i]}" = "HE-AACv2" ]; then + if [ "$(echo ${channels[$i]} | awk '{print $2}')" != "2" ]; then + echo + error "-> HE-AACv2 only supports Stereo!" + error "-> Forcing stereo output decoding" + echo + channels[$i]="-channels 2" + fi + else + printf "Track $i: How many Channels to Output? [1/2/3/4/5/6 - default is 2]: " + read outchan[$i] + case "${outchan[$i]}" in + 1) chanfilter[$i]="channels=1," ;; + 2|"") chanfilter[$i]="channels=2," ;; + 3) chanfilter[$i]="channels=3," ;; + 4) chanfilter[$i]="channels=4," ;; + 5) chanfilter[$i]="channels=5," ;; + 6) chanfilter[$i]="channels=6," ;; + *) + echo + error "-> '${outchan[$i]}' channels not supported!" + error "-> Exiting in function: audio_channels_decode_func()" + echo + exit_func 1 + ;; + esac fi else - printf "Track $i: How many Channels to Output? [1/2/3/4/5/6 - default is 2]: " - read outchan[$i] - case "${outchan[$i]}" in - 1) chanfilter[$i]="channels=1," ;; - 2|"") chanfilter[$i]="channels=2," ;; - 3) chanfilter[$i]="channels=3," ;; - 4) chanfilter[$i]="channels=4," ;; - 5) chanfilter[$i]="channels=5," ;; - 6) chanfilter[$i]="channels=6," ;; - *) - echo - error "-> '${outchan[$i]}' channels not supported!" - error "-> Exiting in function: audio_channels_decode_func()" - echo - exit_func 1 - ;; - esac + echo + error "-> The DISABLE_ALL_AUD_FILTERS variable in the config file" + error " is set to \"y\" which disables all audio filters at once." + error "-> Set it to \"n\" to enable the audio filters." fi ;; *|"") @@ -6368,6 +6411,15 @@ fi } +ask_audio_filters_func() { + if [ "$DISABLE_ALL_AUD_FILTERS" = "n" ]; then + audio_filters_func $1 + audio_filters_var_func $1 + else + true + fi +} + # Call the audio functions above. # Order is important here and the # correct way to call the functions @@ -6387,28 +6439,24 @@ case "${audiocodec[$i]}" in aac|"") faac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; neroaac) neroaac_audio_func aac_hev2_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; fdkaac) fdkaac_audio_func aac_hev2_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; aac+) aacplus_audio_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; nosound) @@ -6429,20 +6477,17 @@ case "${audiocodec[$i]}" in aac|"") faac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; neroaac) neroaac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; fdkaac) fdkaac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; nosound) @@ -6464,22 +6509,19 @@ ac3|"") select_ac3_encoder_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; eac3) eac3_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; dts) dts_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; copy) @@ -6504,8 +6546,7 @@ ac3|"") select_ac3_encoder_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; copy) @@ -6530,22 +6571,19 @@ aac|"") faac_audio_func $3 audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; neroaac) neroaac_audio_func $3 audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; fdkaac) fdkaac_audio_func $3 audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; copy) @@ -6569,26 +6607,22 @@ case "${audiocodec[$i]}" in mp3) mp3_audio_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; aac|"") faac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; neroaac) neroaac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; fdkaac) fdkaac_audio_func $3 - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; nosound) @@ -6609,86 +6643,74 @@ case "${audiocodec[$i]}" in mp3) mp3_audio_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; ac3) select_ac3_encoder_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; eac3) eac3_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; dts) dts_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; aac|"") faac_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; aac+) aacplus_audio_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; neroaac) neroaac_audio_func audio_channels_decode_func aac_hev2_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; fdkaac) fdkaac_audio_func audio_channels_decode_func aac_hev2_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; vorbis) vorbis_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; opus) opus_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; flac) flac_audio_func audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; pcm) acodec[$i]="-oac pcm" audio_channels_decode_func - audio_filters_func $3 - audio_filters_var_func $3 + ask_audio_filters_func $3 audio_track_echo_func ;; copy)
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
.