文件名称:FFmpeg(liunx中amr转MP3工具)
文件大小:17.7MB
文件格式:XZ
更新时间:2020-10-15 04:41:49
ffmpeg
xz -d ***.tar.xz tar -xvf ***.tar public static boolean amrToMp3(String localPath, String targetFilePath,String fileUrl) { try { System.out.println("************** ffmpeg ****************"); java.lang.Runtime rt = Runtime.getRuntime(); //命令 String command = fileUrl+"ffmpeg -i " + localPath + " " + targetFilePath; //执行amr转MP3命令 Process proc = rt.exec(command); InputStream stderr = proc.getErrorStream(); InputStreamReader isr = new InputStreamReader(stderr); BufferedReader br = new BufferedReader(isr); String line = null; StringBuffer sb = new StringBuffer(); while ((line = br.readLine()) != null) sb.append(line); System.out.println("ffmpeg Process errorInfo: " + sb.toString()); int exitVal = proc.waitFor(); System.out.println("ffmpeg Process exitValue: " + exitVal); return true; } catch (Exception e) { System.out.println("ffmpeg exec cmd Exception " + e.toString()); } return false; }