1. 首页
  2. 行业
  3. 互联网
  4. ImageToVideo.zip

ImageToVideo.zip

上传者: 2021-05-01 15:36:25上传 ZIP文件 134.7KB 热度 7次
把图片转成mp4节目 核心代码 private void performJcodec() { try { Log.e("performJcodec: ", "执行开始"); SequenceEncoderMp4 se = null; File file = new File(Constants.FILE_PICTRUES_FLODER); File out = new File(Constants.FILE_FOLDER, "jcodec_enc.mp4"); se = new SequenceEncoderMp4(out); File[] files = file.listFiles(); for (int i = 0; i < files.length; i++) { if (!files[i].exists()) { break; } Bitmap frame = BitmapUtil.decodeSampledBitmapFromFile(files[i].getAbsolutePath() , 480 , 320); se.encodeImage(frame); Log.e("performJcodec: ", "执行到的图片是 " + i); } se.finish(); Log.e("performJcodec: ", "执行完成"); sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(out))); } catch (IOException e) { Log.e("performJcodec: ", "执行异常 " + e.toString()); } }
下载地址
用户评论