纯java实现图片转视频代码,附带依赖包首先设置视频信息DefaultMovieInfoProviderdmip=newDefaultMovieInfoProvider("dst.avi");//生成视频的名称dmip.setFPS(3);//设置每秒帧数dmip.setNumberOfFrames(jpgs.length);//总帧数//视频宽和高,最好与图片宽高保持一直dmip.setMWidth(1440);dmip.setMHeight(860);下面直接初始化Jim2Mov并调用saveMovie方法开始转换视频newJim2Mov(newImageProvider(){publicbyte[]getImage(intframe){try{//设置压缩比returnMovieUtils.convertImageToJPEG((jpgs[frame]),1.0f);}catch(IOExceptione){e.printStackTrace();}returnnull;}},dmip,null).saveMovie(MovieInfoProvider.TYPE_AVI_MJPEG);
1