1,使用ffmpeg:npm install @ffmpeg/ffmpeg @ffmpeg/core -S
;
2,vue 引入ffmpeg
import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
3,需要配置vue.config.js,否则会报错
const { defineConfig } = require('@vue/cli-service')module.exports = defineConfig({ transpileDependencies: true, devServer: { headers: { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp", }, }})
完整代码:
视频前端压缩
{{ msg }}
来源地址:https://blog.csdn.net/weixin_44467587/article/details/129408794