代码如下
如何判断我的文件是否转换完成,然后给出提示信息private static boolean processFLV(String oldfilepath)
{
if (!checkfile(PATH))
{
System.out.println(oldfilepath + " is not file");
return false;
} List<String> commend = new java.util.ArrayList<String>();
commend.add(ffmpeg);
commend.add("-i");
commend.add(oldfilepath);
commend.add("-ab");
commend.add("56");
commend.add("-ar");
commend.add("22050");
commend.add("-b");
commend.add("400k");
commend.add("-r");
commend.add("55");
commend.add("-s");
commend.add("320*240");
commend.add(out);
// ./ffmpeg -i "/opt/input/1.mpg" -y -ab 32 -ar 22050 -b 800000 -s
// 640*480 /opt/output/1.flv
try
{
ProcessBuilder builder = new ProcessBuilder();
builder.command(commend);
builder.start();
return true;
} catch (Exception e)
{
e.printStackTrace();
return false;
}
}