X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=scripts%2Fmanicure.rb;h=317ea05aa784648ca661c84a125a4fee0eacba7b;hb=38411ed3d2e33bd434f7f255279924eba7c55e46;hp=982fe3f1c71a2e391039a1f4c1f8ab985136a268;hpb=25e0cbab99a8a2e68d9b199f025451a46f91d820;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/scripts/manicure.rb b/scripts/manicure.rb index 982fe3f1..317ea05a 100755 --- a/scripts/manicure.rb +++ b/scripts/manicure.rb @@ -275,10 +275,6 @@ class Display case hash["FileFormat"] when /MP4/ commandString << "mp4 " - when /AVI/ - commandString << "avi " - when /OGM/ - commandString << "ogm " when /MKV/ commandString << "mkv " end @@ -289,8 +285,8 @@ class Display case hash["VideoEncoder"] when /x264/ commandString << "x264" - when /XviD/ - commandString << "xvid" + when /Theora/ + commandString << "theora" end end @@ -391,10 +387,6 @@ class Display case hash["FileFormat"] when /MP4/ commandString << "mp4" - when /AVI/ - commandString << "avi" - when /OGM/ - commandString << "ogm" when /MKV/ commandString << "mkv" end @@ -432,7 +424,7 @@ class Display end #Subtitles - if hash["Subtitles"] != "None" + if hash["Subtitles"] && hash["Subtitles"] != "None" if hash["Subtitles"] == "Autoselect" commandString << " --subtitle-scan" else @@ -445,37 +437,38 @@ class Display if hash["UsesPictureFilters"] == 1 case hash["PictureDeinterlace"] - when 1 - commandString << " --deinterlace=\"fast\"" when 2 - commandString << " --deinterlace=\slow\"" + commandString << " --deinterlace=\"fast\"" when 3 - commandString << " --deinterlace=\"slower\"" + commandString << " --deinterlace=\slow\"" when 4 + commandString << " --deinterlace=\"slower\"" + when 5 commandString << " --deinterlace=\"slowest\"" end case hash["PictureDenoise"] - when 1 - commandString << " --denoise=\"weak\"" when 2 - commandString << " --denoise=\"medium\"" + commandString << " --denoise=\"weak\"" when 3 + commandString << " --denoise=\"medium\"" + when 4 commandString << " --denoise=\"strong\"" end - if hash["PictureDetelecine"] == 1 then commandString << " --detelecine" end - if hash["PictureDeblock"] == 1 then commandString << " --deblock" end - if hash["VFR"].to_i == 1 then commandString << " --vfr" end - if hash["PictureDecomb"] == 1 then commandString << " --decomb" end + if hash["PictureDetelecine"] == 2 then commandString << " --detelecine" end + if hash["PictureDeblock"] != 0 then commandString << " --deblock=" << hash["PictureDeblock"].to_s end + if hash["PictureDecomb"] == 2 then commandString << " --decomb" end end #Anamorphic if hash["PicturePAR"] == 1 - commandString << " -p" + commandString << " --strict-anamorphic" elsif hash["PicturePAR"] == 2 - commandString << " -P" + commandString << " --loose-anamorphic" + elsif hash["PicturePAR"] == 3 + commandString << " --custom-anamorphic" end #Booleans @@ -535,8 +528,8 @@ class Display case hash["VideoEncoder"] when /x264/ commandString << "x264" - when /XviD/ - commandString << "xvid" + when /Theora/ + commandString << "theora" end end @@ -637,10 +630,6 @@ class Display case hash["FileFormat"] when /MP4/ commandString << "mp4" - when /AVI/ - commandString << "avi" - when /OGM/ - commandString << "ogm" when /MKV/ commandString << "mkv" end @@ -678,7 +667,7 @@ class Display end #Subtitles - if hash["Subtitles"] != "None" + if hash["Subtitles"] && hash["Subtitles"] != "None" if hash["Subtitles"] == "Autoselect" commandString << " --subtitle-scan" else @@ -691,36 +680,37 @@ class Display if hash["UsesPictureFilters"] == 1 case hash["PictureDeinterlace"] - when 1 - commandString << " --deinterlace=\"fast\"" when 2 - commandString << " --deinterlace=\slow\"" + commandString << " --deinterlace=\"fast\"" when 3 - commandString << " --deinterlace=\"slower\"" + commandString << " --deinterlace=\slow\"" when 4 + commandString << " --deinterlace=\"slower\"" + when 5 commandString << " --deinterlace=\"slowest\"" end case hash["PictureDenoise"] - when 1 - commandString << " --denoise=\"weak\"" when 2 - commandString << " --denoise=\"medium\"" + commandString << " --denoise=\"weak\"" when 3 + commandString << " --denoise=\"medium\"" + when 4 commandString << " --denoise=\"strong\"" end - if hash["PictureDetelecine"] == 1 then commandString << " --detelecine" end - if hash["PictureDeblock"] == 1 then commandString << " --deblock" end - if hash["VFR"].to_i == 1 then commandString << " --vfr" end - if hash["PictureDecomb"] == 1 then commandString << " --decomb" end + if hash["PictureDetelecine"] == 2 then commandString << " --detelecine" end + if hash["PictureDeblock"] != 0 then commandString << " --deblock=" << hash["PictureDeblock"].to_s end + if hash["PictureDecomb"] == 2 then commandString << " --decomb" end end #Anamorphic if hash["PicturePAR"] == 1 - commandString << " -p" + commandString << " --strict-anamorphic" elsif hash["PicturePAR"] == 2 - commandString << " -P" + commandString << " --loose-anamorphic" + elsif hash["PicturePAR"] == 3 + commandString << " --custom-anamorphic" end #Booleans @@ -754,10 +744,6 @@ class Display case hash["FileFormat"] when /MP4/ commandString << " mux = " << "HB_MUX_MP4;\n " - when /AVI/ - commandString << " mux = " << "HB_MUX_AVI;\n " - when /OGM/ - commandString << " mux = " << "HB_MUX_OGM;\n " when /MKV/ commandString << " mux = " << "HB_MUX_MKV;\n " end @@ -765,7 +751,7 @@ class Display #iPod MP4 atom if hash["Mp4iPodCompatible"].to_i == 1 - commandString << "job->ipod_atom = 1;\n " + commandString << "job->ipod_atom = 1;\n " end # 64-bit files @@ -779,8 +765,8 @@ class Display case hash["VideoEncoder"] when /x264/ commandString << "HB_VCODEC_X264;\n " - when /XviD/ - commandString << "HB_VCODEC_XVID;\n " + when /Theora/ + commandString << "HB_VCODEC_THEORA;\n " end end @@ -792,7 +778,6 @@ class Display commandString << "job->vbitrate = " << hash["VideoAvgBitrate"] << ";\n " when 2 commandString << "job->vquality = " << hash["VideoQualitySlider"].to_s << ";\n " - commandString << "job->crf = 1;\n " end #FPS @@ -911,7 +896,7 @@ class Display commandString << "job->crop[0] = " << hash["PictureTopCrop"].to_s << ";\n " commandString << "job->crop[1] = " << hash["PictureBottomCrop"].to_s << ";\n " commandString << "job->crop[2] = " << hash["PictureLeftCrop"].to_s << ";\n " - commandString << "job->crop[4] - " << hash["PictureRightCrop"].to_s << ";\n " + commandString << "job->crop[4] = " << hash["PictureRightCrop"].to_s << ";\n " end #Dimensions @@ -947,44 +932,49 @@ class Display if hash["UsesPictureFilters"] == 1 case hash["PictureDeinterlace"] - when 1 + when 2 commandString << "deinterlace = 1;\n " commandString << "deinterlace_opt = \"-1\";\n " - when 2 + when 3 commandString << "deinterlace = 1;\n " commandString << "deinterlace_opt = \"2\";\n " - when 3 + when 4 commandString << "deinterlace = 1;\n " commandString << "deinterlace_opt = \"0\";\n " - when 4 + when 5 commandString << "deinterlace = 1;\n " commandString << "deinterlace_opt = \"1:-1:1\";\n " end case hash["PictureDenoise"] - when 1 + when 2 commandString << "denoise = 1;\n " commandString << "denoise_opt = \"2:1:2:3\";\n " - when 2 + when 3 commandString << "denoise = 1;\n " commandString << "denoise_opt = \"3:2:2:3\";\n " - when 3 + when 4 commandString << "denoise = 1;\n " commandString << "denoise_opt = \"7:7:5:5\";\n " end - if hash["PictureDetelecine"] == 1 then commandString << "detelecine = 1;\n " end - if hash["PictureDeblock"] == 1 then commandString << "deblock = 1;\n " end - if hash["VFR"].to_i == 1 then commandString << "vfr = 1;\n " end - if hash["PictureDecomb"] == 1 then commandString << "decomb = 1;\n " end + if hash["PictureDetelecine"] == 2 then commandString << "detelecine = 1;\n " end + if hash["PictureDeblock"] != 0 + then + commandString << "deblock = 1;\n " + commandString << "deblock_opt = \"" << hash["PictureDeblock"].to_s << "\";\n " + end + if hash["PictureDecomb"] == 2 then commandString << "decomb = 1;\n " end end #Anamorphic if hash["PicturePAR"] == 1 - commandString << "pixelratio = 1;\n " + commandString << "anamorphic_mode = 1;\n " elsif hash["PicturePAR"] == 2 - commandString << "pixelratio = 2;\n " + commandString << "anamorphic_mode = 2;\n " + elsif hash["PicturePAR"] == 3 + commandString << "anamorphic_mode = 3;\n " end #Booleans @@ -992,7 +982,7 @@ class Display if hash["VideoGrayScale"] == 1 then commandString << "job->grayscale = 1;\n " end if hash["VideoTwoPass"] == 1 then commandString << "twoPass = 1;\n " end if hash["VideoTurboTwoPass"] == 1 then commandString << "turbo_opts_enabled = 1;\n" end - + commandString << "\n" commandString << "}" # That's it, print to screen now @@ -1045,8 +1035,8 @@ class Display case hash["VideoEncoder"] when /x264/ commandString << "x264 " - when /XviD/ - commandString << "xvid " + when /Theora/ + commandString << "theora " end end @@ -1147,10 +1137,6 @@ class Display case hash["FileFormat"] when /MP4/ commandString << "mp4" - when /AVI/ - commandString << "avi" - when /OGM/ - commandString << "ogm" when /MKV/ commandString << "mkv" end @@ -1188,7 +1174,7 @@ class Display end #Subtitles - if hash["Subtitles"] != "None" + if hash["Subtitles"] && hash["Subtitles"] != "None" if hash["Subtitles"] == "Autoselect" commandString << " --subtitle-scan" else @@ -1201,36 +1187,37 @@ class Display if hash["UsesPictureFilters"] == 1 case hash["PictureDeinterlace"] - when 1 - commandString << " --deinterlace=\\\"fast\\\"" when 2 - commandString << " --deinterlace=\\\slow\\\"" + commandString << " --deinterlace=\\\"fast\\\"" when 3 - commandString << " --deinterlace=\\\"slower\\\"" + commandString << " --deinterlace=\\\slow\\\"" when 4 + commandString << " --deinterlace=\\\"slower\\\"" + when 5 commandString << " --deinterlace=\\\"slowest\\\"" end case hash["PictureDenoise"] - when 1 - commandString << " --denoise=\\\"weak\\\"" when 2 - commandString << " --denoise=\\\"medium\\\"" + commandString << " --denoise=\\\"weak\\\"" when 3 + commandString << " --denoise=\\\"medium\\\"" + when 4 commandString << " --denoise=\\\"strong\\\"" end - if hash["PictureDetelecine"] == 1 then commandString << " --detelecine" end - if hash["PictureDeblock"] == 1 then commandString << " --deblock" end - if hash["VFR"].to_i == 1 then commandString << " --vfr" end - if hash["PictureDecomb"] == 1 then commandString << " --decomb" end + if hash["PictureDetelecine"] == 2 then commandString << " --detelecine" end + if hash["PictureDeblock"] != 0 then commandString << " --deblock=" << hash["PictureDeblock"].to_s end + if hash["PictureDecomb"] == 2 then commandString << " --decomb" end end #Anamorphic if hash["PicturePAR"] == 1 - commandString << " -p" + commandString << " --strict-anamorphic" elsif hash["PicturePAR"] == 2 - commandString << " -P" + commandString << " --loose-anamorphic" + elsif hash["PicturePAR"] == 3 + commandString << " --custom-anamorphic" end #Booleans @@ -1267,4 +1254,4 @@ else # Direct the user to the help puts "\n\tUsage: manicure.rb [options]" puts "\tSee help with -h or --help" -end \ No newline at end of file +end