package cn.cutvideo; |
public class ConvertVideo { |
private final static String INPUTPATH = "c:\\06.avi" ; |
private final static String OUTPATH = "C:\\" ; |
private final static String FFMPEGPATH = " E:\\ffmpeg\\bin\\ffmpeg.exe " ; |
|
public static void main(String[] args) { |
int n = 6 ; |
for ( int i= 0 ;i<n;i++){ |
try { |
Runtime runtime = Runtime.getRuntime(); |
String cut = FFMPEGPATH + "-ss " + i + "0:00 -i " |
+ INPUTPATH |
+ " -c copy -t 600 " + OUTPATH +i+ ".avi" ; |
|
runtime.exec(cut); |
|
} catch (Exception e) { |
e.printStackTrace(); |
|
} |
} |
|
} |
} |