1、base64转化成mp4文件

    /**
     * base64 视频base64字符串
     * videoFilePath  输出视频文件路径带文件名
     */
    public static void base64ToVideo(String base64, String videoFilePath) {
        try {
            //base解密
            byte[] videoByte = new sun.misc.BASE64Decoder().decodeBuffer(base64);
            File videoFile = new File(videoFilePath);
            //输入视频文件
            FileOutputStream fos = new FileOutputStream(videoFile);
            fos.write(videoByte, 0, videoByte.length);
            fos.flush();
            fos.close();
        } catch (IOException e) {
            log.info("base64转换为视频异常");
        }
    }

 

相关文章:

  • 2021-07-08
  • 2022-01-19
  • 2022-01-09
  • 2021-12-04
  • 2021-04-04
  • 2021-12-24
  • 2021-04-24
  • 2021-08-10
猜你喜欢
  • 2021-06-20
  • 2021-04-04
  • 2021-05-15
  • 2021-09-14
  • 2021-08-14
  • 2022-12-23
相关资源
相似解决方案