Changeset 153
- Timestamp:
- 02/16/07 20:28:29 (2 years ago)
- Files:
-
- trunk/src/org/thestaticvoid/iriverter/Converter.java (modified) (4 diffs)
- trunk/src/org/thestaticvoid/iriverter/ConverterUI.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/DVD.java (modified) (1 diff)
- trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/org/thestaticvoid/iriverter/Converter.java
r146 r153 198 198 List commandList = new ArrayList(); 199 199 200 commandList.add(mplayerPath + "mencoder");200 commandList.add(mplayerPath + MPlayerInfo.MENCODER_BIN); 201 201 202 202 commandList.add(inputVideo); … … 363 363 364 364 if (manualSplitInfo.getMarks()[0].getTime() == Mark.START_MARK) 365 runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + manualSplitInfo.getMarks()[1].getTime()});365 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + manualSplitInfo.getMarks()[1].getTime()}); 366 366 else if (manualSplitInfo.getMarks()[1].getTime() == Mark.END_MARK) 367 runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime()});367 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime()}); 368 368 else 369 runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime(), "-endpos", "" + (manualSplitInfo.getMarks()[1].getTime() - manualSplitInfo.getMarks()[0].getTime())});369 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime(), "-endpos", "" + (manualSplitInfo.getMarks()[1].getTime() - manualSplitInfo.getMarks()[0].getTime())}); 370 370 } 371 371 … … 413 413 progressDialogInfo.setOutputVideo(new File(joinVideosInfo.getOutputVideo()).getName()); 414 414 progressDialogInfo.setStatus("Writing header"); 415 splitVideo(joinVideosInfo.getOutputVideo(), runConversionCommand(new String[]{mplayerPath + "mencoder", "-forceidx", tempFile.toString(), "-o", joinVideosInfo.getOutputVideo(), "-ovc", "copy", "-oac", "copy"}));415 splitVideo(joinVideosInfo.getOutputVideo(), runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, "-forceidx", tempFile.toString(), "-o", joinVideosInfo.getOutputVideo(), "-ovc", "copy", "-oac", "copy"})); 416 416 } 417 417 } catch (IOException e) { … … 467 467 468 468 if ((i + 1) == 1) 469 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + (length / pieces)});469 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + (length / pieces)}); 470 470 else if ((i + 1) == pieces) 471 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i});471 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i}); 472 472 else 473 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i, "-endpos", "" + (length / pieces)});473 runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i, "-endpos", "" + (length / pieces)}); 474 474 } 475 475 } trunk/src/org/thestaticvoid/iriverter/ConverterUI.java
r152 r153 423 423 while (!canceled) 424 424 try { 425 proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + "mplayer", file});425 proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + MPlayerInfo.MPLAYER_BIN, file}); 426 426 canceled = true; 427 427 } catch (IOException io) { trunk/src/org/thestaticvoid/iriverter/DVD.java
r152 r153 220 220 try { 221 221 java.util.List commandList = new ArrayList(); 222 commandList.add(MPlayerInfo.getMPlayerPath() + "mplayer");222 commandList.add(MPlayerInfo.getMPlayerPath() + File.separator + MPlayerInfo.MPLAYER_BIN); 223 223 commandList.add("-dvd-device"); 224 224 commandList.add(getDrive()); trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java
r151 r153 27 27 28 28 public class MPlayerInfo { 29 public static final String MPLAYER_BIN = System.getProperty("os.name").indexOf("Windows") > 0 ? "mplayer.exe" : "mplayer"; 30 public static final String MENCODER_BIN = System.getProperty("os.name").indexOf("Windows") > 0 ? "mencoder.exe" : "mencoder"; 31 29 32 private Process proc; 30 33 private StringBuffer mplayerOutput; … … 42 45 String[] command = null; 43 46 if (dvdDrive != null) 44 command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"};47 command = new String[]{mplayerPath + File.separator + MPLAYER_BIN, "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"}; 45 48 else 46 command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"};49 command = new String[]{mplayerPath + File.separator + MPLAYER_BIN, "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"}; 47 50 48 51 String commandStr = ""; … … 54 57 proc = Runtime.getRuntime().exec(command); 55 58 } catch (IOException io) { 56 io.printStackTrace();59 Logger.logException(io); 57 60 } 58 61 … … 69 72 input.close(); 70 73 } catch (IOException io) { 71 io.printStackTrace();74 Logger.logException(io); 72 75 } 73 76 }
