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

FFmpeg is not defined #529

Closed
Jveshi opened this issue Aug 3, 2023 · 3 comments
Closed

FFmpeg is not defined #529

Jveshi opened this issue Aug 3, 2023 · 3 comments

Comments

@Jveshi
Copy link

Jveshi commented Aug 3, 2023

Describe the bug
FFmpeg is not defined

I used to use version 0.11.x, recently released 0.12.x, I need to make changes to the code.
I downloaded the required files into a local directory and referenced them.
image

<script type="text/javascript" src="https://www.xxx.com/source/reference/project/ffmpeg.wasm/ffmpeg/dist/umd/ffmpeg.js"></script> <script type="text/javascript" src="https://www.xxx.com/source/reference/project/ffmpeg.wasm/util/dist/umd/index.js"></script>

But when I started using it, an error occurred, what should I do.

const ffmpeg = new FFmpeg();

image


Try it on the official page, such as Playground, the result is the same.

image

Desktop:

  • OS: window 10
  • Browser: chrome
@rambo-panda
Copy link

window.FFmpegWASM.FFmpeg

@Jveshi
Copy link
Author

Jveshi commented Aug 3, 2023

window.FFmpegWASM.FFmpeg

I get it, I made a mistake according to the official docs.did not write this code

const { FFmpeg } = FFmpegWASM; const { fetchFile } = FFmpegUtil;


But then encountered a new problem
image
image
But if change it to this, it will be fine.
image


The new version seems to be slower. (maybe the code is still buggy with multithreading not enabled) What is your situation?
V0.12.2
image
V0.11.6
image

@jeromewu
Copy link
Collaborator

jeromewu commented Aug 3, 2023

The core you use in v0.12.2 is single-thread, that's why it is slower. You can use core-mt instead.

More details: https://ffmpegwasm.netlify.app/docs/getting-started/usage#transcoding-video-multi-thread

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

3 participants