回覆列表
  • 1 # CoreCode

    程式碼如下

    import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.io.*; import java.lang.*; import java.util.*; import java.text.*; import java.net.*; public class Test { public static void main(String[] args) { List<String> commend = new ArrayList<String>(); commend.add("/usr/local/ffmpeg2/bin/./ffmpeg"); commend.add("-i"); commend.add("/opt/spzh/yysp.avi"); commend.add("-ab"); commend.add("128"); commend.add("-acodec"); commend.add("libfaac"); commend.add("-ac"); commend.add("1"); commend.add("-ar"); commend.add("22050"); commend.add("-r"); commend.add("24"); commend.add("-y"); commend.add("/opt/spzh/out/yysp18.flv"); StringBuffer test=new StringBuffer(); for(int i=0;i<commend.size();i++) test.append(commend.get(i)+" "); System.out.println(test); try { Runtime rt = Runtime.getRuntime(); Process proc = rt.exec(test.toString()); InputStream stderr = proc.getErrorStream(); InputStreamReader isr = new InputStreamReader(stderr); BufferedReader br = new BufferedReader(isr); String line = null; while ( (line = br.readLine()) != null); } catch (IOException e) { e.printStackTrace(); } System.out.println("影片轉換成功"); } }

  • 中秋節和大豐收的關聯?
  • 做育嬰月嫂有權力知道僱主服務物件有否傳染病?