OSDN Git Service

Scripts: Updates manicure to handle peak framerate.
[handbrake-jp/handbrake-jp-git.git] / scripts / manicure.rb
index 251c77a..f808b27 100755 (executable)
@@ -311,6 +311,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks
@@ -554,6 +558,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks
@@ -751,7 +759,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
@@ -790,7 +798,12 @@ class Display
         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
@@ -896,7 +909,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
@@ -969,12 +982,17 @@ class Display
     end
     
     #Anamorphic
-    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    "
+    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
@@ -982,7 +1000,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
@@ -1061,6 +1079,10 @@ class Display
       else
         commandString << " -r " << hash["VideoFramerate"]
       end
+      
+      if hash["VideoFrameratePFR"] == 1
+        commandString << " --pfr "
+      end
     end
     
     #Audio tracks
@@ -1254,4 +1276,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