【发布时间】:2015-10-26 13:23:30
【问题描述】:
我正在研究 ffmpeg 视频比较。我从 java 调用 ffmpeg 视频比较命令。执行命令后。比较过程停止。如果我杀死 javaw.exe 命令恢复和工作并创建结果文件。 我正在使用以下代码来执行命令:
String command2CompareVideos = "D:\\bin\\ffmpeg -y -i D:\\postVideo_16.mp4 -i D:\\postVideo_16.mp4 -filter_complex \"[1:v]format=yuva444p,lut=c3=128,negate[video2withAlpha],[0:v][video2withAlpha]overlay[out]\" -map [out] D:\\ResultVideo.mp4"
String[] processCommand = { "cmd", "/c","CALL", command2CompareVideos};
Process imgComProcess = Runtime.getRuntime().exec(processCommand);
imgComProcess.waitFor();
BufferedReader ouPiutReader = new BufferedReader(new InputStreamReader(imgComProcess.getInputStream()));
String outPut = ouPiutReader.readLine();
while(outPut != null){
outPut = ouPiutReader.readLine();
System.out.println("Output: "+outPut);
}
【问题讨论】:
-
您的
ffmpeg命令在手动运行和无脚本运行时是否正常工作? -
是的。当我从命令提示符运行时,它工作正常。