This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.File; | |
| import java.util.ArrayList; | |
| import java.util.Calendar; | |
| import java.util.List; | |
| public class ConvertVideo { | |
| private final static String PATH = "c:\\ffmpeg\\input\\c.mp4"; | |
| public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.Calendar; | |
| import java.util.List; | |
| public class ConvertVideo { | |
| private static String inputPath = ""; | |
| private static String outputPath = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| builder.command(commend); | |
| builder.start(); | |
| return "c:\\ffmpeg\\output\\a.avi"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| builder.start(); | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process process = new ProcessBuilder(command).start(); | |
| process.waitFor(); | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process process = new ProcessBuilder(command).start(); | |
| while (true) { | |
| try { | |
| if (process.exitValue() == 0) | |
| break; | |
| } | |
| catch (IllegalThreadStateException e) { | |
| continue; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process process = new ProcessBuilder(command).start(); | |
| new PrintStream(process.getInputStream()).start(); | |
| process.waitFor(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PrintStream extends Thread | |
| { | |
| java.io.InputStream __is = null; | |
| public PrintStream(java.io.InputStream is) | |
| { | |
| __is = is; | |
| } | |
| public void run() | |
| { | |
| try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process videoProcess = new ProcessBuilder(command).redirectErrorStream(true).start(); | |
| new PrintStream(videoProcess.getInputStream()).start(); | |
| videoProcess.waitFor(); | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Process videoProcess = new ProcessBuilder(command).start(); | |
| new PrintStream(videoProcess.getErrorStream()).start(); | |
| new PrintStream(videoProcess.getInputStream()).start(); | |
| videoProcess.waitFor(); | |
| return true; |
OlderNewer