public class VideoProcess {
public static boolean processTransToImg2(String toolPath,String oldfilepath, String newimg) {
try {
Runtime.getRuntime().exec(toolPath+" -i "+oldfilepath+" -y -f image2 -ss 2 -t 0.001 -s 300x200 "+newimg);
D:/ffp/ffmpeg.exe -i F:/javaweb/nSurety/WebRoot/shipin/chengpinwushe.flv -y -f image2 -ss 2 -t 0.001 -s 300x200 d:/ffp/3.jpg
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
public static void main(String[] args) {
String toolPath = "D://ffp//ffmpeg.exe";
String oldfilepath = "F://javaweb//nSurety//WebRoot//shipin//chengpinwushe.flv";
String newimg = "d://ffp//3.jpg";
processTransToImg2(toolPath,oldfilepath, newimg);
System.out.println("over");
}
}