diff options
author | Rodeo <[email protected]> | 2012-03-25 15:24:50 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2012-03-25 15:24:50 +0000 |
commit | 5f9578cc46e6b7c88477542815b6f8c3eaa6ee5f (patch) | |
tree | 1724d5b8256e4f32758ae5793e274058ba2f48df /scripts/manicure.rb | |
parent | 763a1742df56afd54602dea5c42c4fb6d0f27ef5 (diff) |
Add Auto Passthru support to manicure.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4539 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'scripts/manicure.rb')
-rwxr-xr-x | scripts/manicure.rb | 325 |
1 files changed, 277 insertions, 48 deletions
diff --git a/scripts/manicure.rb b/scripts/manicure.rb index bfa4f685a..8f7b063e0 100755 --- a/scripts/manicure.rb +++ b/scripts/manicure.rb @@ -361,22 +361,24 @@ class Display audioEncoders << "lame" when /FLAC/ audioEncoders << "ffflac" + when /Auto Pass/ + audioEncoders << "copy" end #Mixdowns case audioTrack["AudioMixdown"] - when /Mono/ - audioMixdowns << "mono" - when /Stereo/ - audioMixdowns << "stereo" - when /Dolby Surround/ - audioMixdowns << "dpl1" - when /Dolby Pro Logic II/ - audioMixdowns << "dpl2" - when /discrete/ - audioMixdowns << "6ch" - when /None/ - audioMixdowns << "auto" + when /Mono/ + audioMixdowns << "mono" + when /Stereo/ + audioMixdowns << "stereo" + when /Dolby Surround/ + audioMixdowns << "dpl1" + when /Dolby Pro Logic II/ + audioMixdowns << "dpl2" + when /discrete/ + audioMixdowns << "6ch" + when /None/ + audioMixdowns << "auto" end #Samplerates @@ -404,6 +406,63 @@ class Display commandString << " -6 " << audioMixdowns commandString << " -R " << audioSamplerates commandString << " -D " << audioTrackDRCs + + #Auto Passthru Mask + audioCopyMask = "" + + if hash["AudioAllowAACPass"].to_i == 1 + audioCopyMask << "aac" + end + if hash["AudioAllowAC3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "ac3" + end + if hash["AudioAllowDTSHDPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dtshd" + end + if hash["AudioAllowDTSPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dts" + end + if hash["AudioAllowMP3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "mp3" + end + + if audioCopyMask.size > 0 + commandString << " --audio-copy-mask " << audioCopyMask + end + + #Auto Passthru Fallback + audioEncoderFallback = "" + + case hash["AudioEncoderFallback"] + when /AC3/ + audioEncoderFallback << "ffac3" + when "AAC (ffmpeg)" + audioEncoderFallback << "ffaac" + when /AAC/ + audioEncoderFallback << "faac" + when /Vorbis/ + audioEncoderFallback << "vorbis" + when /MP3/ + audioEncoderFallback << "lame" + when /FLAC/ + audioEncoderFallback << "ffflac" + end + + if audioEncoderFallback.size > 0 + commandString << " --audio-fallback " << audioEncoderFallback + end #Container commandString << " -f " @@ -632,22 +691,24 @@ class Display audioEncoders << "lame" when /FLAC/ audioEncoders << "ffflac" + when /Auto Pass/ + audioEncoders << "copy" end #Mixdowns case audioTrack["AudioMixdown"] - when /Mono/ - audioMixdowns << "mono" - when /Stereo/ - audioMixdowns << "stereo" - when /Dolby Surround/ - audioMixdowns << "dpl1" - when /Dolby Pro Logic II/ - audioMixdowns << "dpl2" - when /discrete/ - audioMixdowns << "6ch" - when /None/ - audioMixdowns << "auto" + when /Mono/ + audioMixdowns << "mono" + when /Stereo/ + audioMixdowns << "stereo" + when /Dolby Surround/ + audioMixdowns << "dpl1" + when /Dolby Pro Logic II/ + audioMixdowns << "dpl2" + when /discrete/ + audioMixdowns << "6ch" + when /None/ + audioMixdowns << "auto" end #Samplerates @@ -676,6 +737,63 @@ class Display commandString << " -R " << audioSamplerates commandString << " -D " << audioTrackDRCs + #Auto Passthru Mask + audioCopyMask = "" + + if hash["AudioAllowAACPass"].to_i == 1 + audioCopyMask << "aac" + end + if hash["AudioAllowAC3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "ac3" + end + if hash["AudioAllowDTSHDPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dtshd" + end + if hash["AudioAllowDTSPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dts" + end + if hash["AudioAllowMP3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "mp3" + end + + if audioCopyMask.size > 0 + commandString << " --audio-copy-mask " << audioCopyMask + end + + #Auto Passthru Fallback + audioEncoderFallback = "" + + case hash["AudioEncoderFallback"] + when /AC3/ + audioEncoderFallback << "ffac3" + when "AAC (ffmpeg)" + audioEncoderFallback << "ffaac" + when /AAC/ + audioEncoderFallback << "faac" + when /Vorbis/ + audioEncoderFallback << "vorbis" + when /MP3/ + audioEncoderFallback << "lame" + when /FLAC/ + audioEncoderFallback << "ffflac" + end + + if audioEncoderFallback.size > 0 + commandString << " --audio-fallback " << audioEncoderFallback + end + #Container commandString << " -f " case hash["FileFormat"] @@ -903,22 +1021,24 @@ class Display audioEncoders << "lame" when /FLAC/ audioEncoders << "ffflac" + when /Auto Pass/ + audioEncoders << "copy" end #Mixdowns case audioTrack["AudioMixdown"] - when /Mono/ - audioMixdowns << "mono" - when /Stereo/ - audioMixdowns << "stereo" - when /Dolby Surround/ - audioMixdowns << "dpl1" - when /Dolby Pro Logic II/ - audioMixdowns << "dpl2" - when /discrete/ - audioMixdowns << "6ch" - when /None/ - audioMixdowns << "auto" + when /Mono/ + audioMixdowns << "mono" + when /Stereo/ + audioMixdowns << "stereo" + when /Dolby Surround/ + audioMixdowns << "dpl1" + when /Dolby Pro Logic II/ + audioMixdowns << "dpl2" + when /discrete/ + audioMixdowns << "6ch" + when /None/ + audioMixdowns << "auto" end #Samplerates @@ -976,6 +1096,56 @@ class Display commandString << "\");\n " commandString << "}\n " + #Auto Passthru Mask + if hash["AudioAllowAACPass"] + commandString << "if( allowed_audio_copy == -1 )\n " + commandString << "{\n " + commandString << " allowed_audio_copy = 0;\n " + if hash["AudioAllowAACPass"].to_i == 1 + commandString << " allowed_audio_copy |= HB_ACODEC_AAC_PASS;\n " + end + if hash["AudioAllowAC3Pass"].to_i == 1 + commandString << " allowed_audio_copy |= HB_ACODEC_AC3_PASS;\n " + end + if hash["AudioAllowDTSHDPass"].to_i == 1 + commandString << " allowed_audio_copy |= HB_ACODEC_DCA_HD_PASS;\n " + end + if hash["AudioAllowDTSPass"].to_i == 1 + commandString << " allowed_audio_copy |= HB_ACODEC_DCA_PASS;\n " + end + if hash["AudioAllowMP3Pass"].to_i == 1 + commandString << " allowed_audio_copy |= HB_ACODEC_MP3_PASS;\n " + end + commandString << " allowed_audio_copy &= HB_ACODEC_PASS_MASK;\n " + commandString << "}\n " + end + + #Auto Passthru Fallback + audioEncoderFallback = "" + + case hash["AudioEncoderFallback"] + when /AC3/ + audioEncoderFallback << "HB_ACODEC_AC3" + when "AAC (ffmpeg)" + audioEncoderFallback << "HB_ACODEC_FFAAC" + when /AAC/ + audioEncoderFallback << "HB_ACODEC_FAAC" + when /Vorbis/ + audioEncoderFallback << "HB_ACODEC_VORBIS" + when /MP3/ + audioEncoderFallback << "HB_ACODEC_LAME" + when /FLAC/ + audioEncoderFallback << "HB_ACODEC_FFFLAC" + end + + if audioEncoderFallback.size > 0 + commandString << "if( !acodec_fallback )\n " + commandString << "{\n " + commandString << " acodec_fallback = " << audioEncoderFallback + commandString << ";\n " + commandString << "}\n " + end + #Cropping if hash["PictureAutoCrop"] == 0 commandString << "job->crop[0] = " << hash["PictureTopCrop"].to_s << ";\n " @@ -1201,22 +1371,24 @@ class Display audioEncoders << "lame" when /FLAC/ audioEncoders << "ffflac" + when /Auto Pass/ + audioEncoders << "copy" end #Mixdowns case audioTrack["AudioMixdown"] - when /Mono/ - audioMixdowns << "mono" - when /Stereo/ - audioMixdowns << "stereo" - when /Dolby Surround/ - audioMixdowns << "dpl1" - when /Dolby Pro Logic II/ - audioMixdowns << "dpl2" - when /discrete/ - audioMixdowns << "6ch" - when /None/ - audioMixdowns << "auto" + when /Mono/ + audioMixdowns << "mono" + when /Stereo/ + audioMixdowns << "stereo" + when /Dolby Surround/ + audioMixdowns << "dpl1" + when /Dolby Pro Logic II/ + audioMixdowns << "dpl2" + when /discrete/ + audioMixdowns << "6ch" + when /None/ + audioMixdowns << "auto" end #Samplerates @@ -1245,6 +1417,63 @@ class Display commandString << " -R " << audioSamplerates commandString << " -D " << audioTrackDRCs + #Auto Passthru Mask + audioCopyMask = "" + + if hash["AudioAllowAACPass"].to_i == 1 + audioCopyMask << "aac" + end + if hash["AudioAllowAC3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "ac3" + end + if hash["AudioAllowDTSHDPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dtshd" + end + if hash["AudioAllowDTSPass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "dts" + end + if hash["AudioAllowMP3Pass"].to_i == 1 + if audioCopyMask.size > 0 + audioCopyMask << "," + end + audioCopyMask << "mp3" + end + + if audioCopyMask.size > 0 + commandString << " --audio-copy-mask " << audioCopyMask + end + + #Auto Passthru Fallback + audioEncoderFallback = "" + + case hash["AudioEncoderFallback"] + when /AC3/ + audioEncoderFallback << "ffac3" + when "AAC (ffmpeg)" + audioEncoderFallback << "ffaac" + when /AAC/ + audioEncoderFallback << "faac" + when /Vorbis/ + audioEncoderFallback << "vorbis" + when /MP3/ + audioEncoderFallback << "lame" + when /FLAC/ + audioEncoderFallback << "ffflac" + end + + if audioEncoderFallback.size > 0 + commandString << " --audio-fallback " << audioEncoderFallback + end + #Container commandString << " -f " case hash["FileFormat"] |