case hash["FileFormat"]
when /MP4/
commandString << "mp4 "
- when /AVI/
- commandString << "avi "
- when /OGM/
- commandString << "ogm "
when /MKV/
commandString << "mkv "
end
case hash["VideoEncoder"]
when /x264/
commandString << "x264"
- when /XviD/
- commandString << "xvid"
+ when /Theora/
+ commandString << "theora"
end
end
else
commandString << " -r " << hash["VideoFramerate"]
end
+
+ if hash["VideoFrameratePFR"] == 1
+ commandString << " --pfr "
+ end
end
#Audio tracks
case hash["FileFormat"]
when /MP4/
commandString << "mp4"
- when /AVI/
- commandString << "avi"
- when /OGM/
- commandString << "ogm"
when /MKV/
commandString << "mkv"
end
end
#Subtitles
- if hash["Subtitles"] != "None"
+ if hash["Subtitles"] && hash["Subtitles"] != "None"
if hash["Subtitles"] == "Autoselect"
commandString << " --subtitle-scan"
else
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
commandString << " --strict-anamorphic"
elsif hash["PicturePAR"] == 2
commandString << " --loose-anamorphic"
+ elsif hash["PicturePAR"] == 3
+ commandString << " --custom-anamorphic"
end
#Booleans
case hash["VideoEncoder"]
when /x264/
commandString << "x264"
- when /XviD/
- commandString << "xvid"
+ when /Theora/
+ commandString << "theora"
end
end
else
commandString << " -r " << hash["VideoFramerate"]
end
+
+ if hash["VideoFrameratePFR"] == 1
+ commandString << " --pfr "
+ end
end
#Audio tracks
case hash["FileFormat"]
when /MP4/
commandString << "mp4"
- when /AVI/
- commandString << "avi"
- when /OGM/
- commandString << "ogm"
when /MKV/
commandString << "mkv"
end
end
#Subtitles
- if hash["Subtitles"] != "None"
+ if hash["Subtitles"] && hash["Subtitles"] != "None"
if hash["Subtitles"] == "Autoselect"
commandString << " --subtitle-scan"
else
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
commandString << " --strict-anamorphic"
elsif hash["PicturePAR"] == 2
commandString << " --loose-anamorphic"
+ elsif hash["PicturePAR"] == 3
+ commandString << " --custom-anamorphic"
end
#Booleans
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
#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
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
commandString << "job->vbitrate = " << hash["VideoAvgBitrate"] << ";\n "
when 2
commandString << "job->vquality = " << hash["VideoQualitySlider"].to_s << ";\n "
- commandString << "job->crf = 1;\n "
end
#FPS
commandString << "job->vrate_base = " << "1080000\n "
# Gotta add the rest of the framerates for completion's sake.
end
- commandString << "job->cfr = 1;\n "
+
+ if hash["VideoFrameratePFR"] == 1
+ commandString << "job->cfr = 2;\n "
+ else
+ commandString << "job->cfr = 1;\n "
+ end
end
#Audio tracks
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
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 << "anamorphic_mode = 1;\n "
- elsif hash["PicturePAR"] == 2
- commandString << "anamorphic_mode = 2;\n "
+ if hash["PicturePAR"] != 0
+ commandString << "if( !anamorphic_mode )\n "
+ commandString << "{\n "
+ if hash["PicturePAR"] == 1
+ commandString << " anamorphic_mode = 1;\n "
+ elsif hash["PicturePAR"] == 2
+ commandString << " anamorphic_mode = 2;\n "
+ elsif hash["PicturePAR"] == 3
+ commandString << " anamorphic_mode = 3;\n "
+ end
+ commandString << "}\n "
end
#Booleans
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
case hash["VideoEncoder"]
when /x264/
commandString << "x264 "
- when /XviD/
- commandString << "xvid "
+ when /Theora/
+ commandString << "theora "
end
end
else
commandString << " -r " << hash["VideoFramerate"]
end
+
+ if hash["VideoFrameratePFR"] == 1
+ commandString << " --pfr "
+ end
end
#Audio tracks
case hash["FileFormat"]
when /MP4/
commandString << "mp4"
- when /AVI/
- commandString << "avi"
- when /OGM/
- commandString << "ogm"
when /MKV/
commandString << "mkv"
end
end
#Subtitles
- if hash["Subtitles"] != "None"
+ if hash["Subtitles"] && hash["Subtitles"] != "None"
if hash["Subtitles"] == "Autoselect"
commandString << " --subtitle-scan"
else
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
commandString << " --strict-anamorphic"
elsif hash["PicturePAR"] == 2
commandString << " --loose-anamorphic"
+ elsif hash["PicturePAR"] == 3
+ commandString << " --custom-anamorphic"
end
#Booleans
# 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