Skip to content

Instantly share code, notes, and snippets.

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) {
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 = "";
builder.command(commend);
builder.start();
return "c:\\ffmpeg\\output\\a.avi";
builder.start();
return true;
Process process = new ProcessBuilder(command).start();
process.waitFor();
return true;
Process process = new ProcessBuilder(command).start();
while (true) {
try {
if (process.exitValue() == 0)
break;
}
catch (IllegalThreadStateException e) {
continue;
}
}
Process process = new ProcessBuilder(command).start();
new PrintStream(process.getInputStream()).start();
process.waitFor();
class PrintStream extends Thread
{
java.io.InputStream __is = null;
public PrintStream(java.io.InputStream is)
{
__is = is;
}
public void run()
{
try
Process videoProcess = new ProcessBuilder(command).redirectErrorStream(true).start();
new PrintStream(videoProcess.getInputStream()).start();
videoProcess.waitFor();
return true;
Process videoProcess = new ProcessBuilder(command).start();
new PrintStream(videoProcess.getErrorStream()).start();
new PrintStream(videoProcess.getInputStream()).start();
videoProcess.waitFor();
return true;