public class VideoThumbTaker
{
protected static String ffmpegApp;
public VideoThumbTaker(String ffmpegApp)
{
this.ffmpegApp = ffmpegApp;
}
@SuppressWarnings(“unused”)
/**
* 获取指定时间内的图片
* @param videoFilename:视频路径
* @param thumbFilename:图片保存路径
* @param width:图片长
* @param height:图片宽
* @param hour:指定时
* @param min:指定分
* @param sec:指定秒
* @throws IOException
* @throws InterruptedException
*/
public void V2PAll(String videoFilename, String thumbFilename,int width,
int height,int hour, int min,float sec) throws IOException, InterruptedException{
System.out.printf(“%d:%d:%.3f\n”,hour,min,sec);
System.out.println(“first enter into V2PAll!”);
ProcessBuilder processBuilder = new ProcessBuilder(ffmpegApp,”-y”,
“-i”, videoFilename, thumbFilename+”1.jpg”,