java 调用ffmpeg执行dos bat命令 带有两个参数
import java.io.IOException;
public class TestMencoder {
	
	public static void main(String[] args) {
		String outPath="e:\\output\\o1.flv";  //输出的文件路径
		String inPath="e:\\74.2.mpg";  //要转换的视频文件路径
		String cmd4="e:\\test_par.bat " + inPath+ " "+outPath;
		try {
			Process pr=Runtime.getRuntime().exec(cmd4);
			
			pr.getInputStream();
			System.out.println(cmd4);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}以下为test_par.bat的内容, %1 为第一个参数,%2为第二个参数
cmd /c start D:\foresee\workspace3.2\rr\ffmpeg\ffmpeg.exe -i %1 -y -ab 32 -ar 11025 -b 400000 -s 320*240 %2 echo 完成! echo. & pause
相关推荐
  wangdaren    2020-08-15  
   wqiaofujiang    2020-07-05  
   PGzxc    2020-07-04  
   ShoppingChen    2020-06-25  
   cherayliu    2020-06-17  
   83096129    2020-06-08  
   83096129    2020-06-08  
   PGzxc    2020-06-01  
   ShoppingChen    2020-05-29  
   cherayliu    2020-05-11  
   ShoppingChen    2020-05-11  
   83096129    2020-05-10  
   PGzxc    2020-05-07  
   cherayliu    2020-04-27  
   cherayliu    2020-04-11