赞
踩
- /**
- * 从视频中提取音频
- */
- @Test
- public void videoGetMp3(){
- // 提取命令
- String commit = "$0 -i $1 -ss 00:00:01 -t 00:01:27.0 -vn -b:a 192k -ar 44100 -ac 2 -acodec libmp3lame -y $2";
- // ffmpeg
- String ffmpegPath = "D:\\Java\\operSources\\ffmpeg-4.3.1\\bin\\ffmpeg.exe";
-
-
- String str = commit.replace("$0", ffmpegPath)
- .replace("$1", "D:\\Music\\原创作品\\b3e77534c8bc1ce9ffb8ff2293778eaf.mp4")
- .replace("$2", "D:\\Music\\原创作品\\连锁反应.mp3");
- System.out.println(str);
- Runtime runtime = Runtime.getRuntime();
- try {
- Process proce = runtime.exec(str);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。