home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Software / Utils / Avidemux / avidemux_2.5.2_win32.exe / scripts / auto / Apple / Apple iPod.js < prev   
Encoding:
Text File  |  2009-04-21  |  1.3 KB  |  39 lines

  1. //AD
  2. include("video/autoWizard.js");
  3. include("video/filter.js");
  4.  
  5. var app = new Avidemux();
  6.  
  7. if (app.video == null)
  8.     displayError("A video file must be open to use this Auto Wizard.");
  9. else
  10. {
  11.     var result = videoAutoWizard("Apple iPod Auto Wizard", [[320, 240]]);
  12.  
  13.     if (result)
  14.     {
  15.         var targetX = result[0][0];
  16.         var targetY = result[0][1];
  17.         var sourceRatio = result[1][0] + ":" + result[1][1];
  18.         var destinationRatio = result[2][0] + ":" + result[2][1];
  19.  
  20.         resizeAndFillVideo(targetX, targetY, sourceRatio, destinationRatio);
  21.  
  22.         app.video.codecPlugin("32BCB447-21C9-4210-AE9A-4FCE6C8588AE", "x264", "2PASSBITRATE=600", "<?xml version='1.0'?><x264Config><presetConfiguration><name>Apple iPod</name><type>system</type></presetConfiguration><x264Options></x264Options></x264Config>");
  23.  
  24.         if (app.audio.targetTrackInfo.length > 0)
  25.         {
  26.             if (app.audio.targetTrackInfo[0].codec != "AAC" || app.audio.targetTrackInfo[0].channelCount != 2)
  27.             {
  28.                 app.audio.codec("Faac", 128, 4, "80 00 00 00 ");
  29.  
  30.                 if (app.audio.targetTrackInfo[0].channelCount == 2)
  31.                     app.audio.mixer = "NONE";
  32.                 else
  33.                     app.audio.mixer = "STEREO";
  34.             }
  35.         }
  36.  
  37.         app.setContainer("MP4");
  38.     }
  39. }