Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When executing await ffmpeg.load({...url}), the code doesn't continue to execute further. #815

Open
bestycw opened this issue Jan 9, 2025 · 6 comments

Comments

@bestycw
Copy link

bestycw commented Jan 9, 2025

` if (!crossOriginIsolated) {
throw new Error('SharedArrayBuffer is not available. Please enable cross-origin isolation.')
}
this.ffmpeg.on('log', e => {
console.log(e.message)
})
this.ffmpeg.on('progress', e => {
console.log(e.progress)
})
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/esm'

   await this.ffmpeg.load({
  coreURL: await toBlobURL(`${baseURL}/ffmpeg-core.js`, 'text/javascript'),
  wasmURL: await toBlobURL(`${baseURL}/ffmpeg-core.wasm`, 'application.wasm'),
  // workerURL: await toBlobURL(`${baseURL}/ffmpeg-core.worker.js`, 'text/javascript')
})
this.isLoaded = true
console.log('FFmpeg loaded successfully')

}`

console.log('FFmpeg loaded successfully') does not exec。

THE version ffmpeg
"@ffmpeg/ffmpeg": "^0.12.7", "@ffmpeg/util": "^0.12.1", "@ffmpeg/core": "^0.12.4"

@zhendershot-crux
Copy link

Did you find a workaround - or a solution? I have the same issue right now with 0.12.10.

@VamshiAlugoju
Copy link

@bestycw Did you find any solution?

@L4z3x
Copy link

L4z3x commented Jan 29, 2025

have the same issue too, i am getting this error:
Loading Worker from “http://localhost:5173/node_modules/.vite/deps/worker.js?worker_file&type=module” was blocked because of a disallowed MIME type (“”).

@VamshiAlugoju
Copy link

if you are using vite adding ffmpeg in the exclude array in the optimizedeps filed in vite.config file solved the issue.

import path from "path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
optimizeDeps: {
exclude: ['react-day-picker' ,'@ffmpeg/ffmpeg']
}
});

@L4z3x
Copy link

L4z3x commented Jan 30, 2025

thanks, that worked

@zhendershot-crux
Copy link

zhendershot-crux commented Jan 30, 2025

Yeah - I've seen that suggestion floating around. But I have that and still doesn't change the issue in Safari. Is there anything else going on here that maybe I can check?

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'

export default defineConfig({
  plugins: [react()],
  base: './',
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
  optimizeDeps: {
    exclude: ["@ffmpeg/ffmpeg", "@ffmpeg/util"],
  },
  build: {
    sourcemap: false,
    rollupOptions: {
      output: {
        manualChunks: undefined
      }
    }
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants