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

Uncaught ReferenceError: createFFmpegCore is not defined at HTMLScriptElement.eventHandler (getCreateFFmpegCore.js:43:1) #705

Open
nareshallakonda opened this issue Mar 13, 2024 · 0 comments

Comments

@nareshallakonda
Copy link

nareshallakonda commented Mar 13, 2024

"@ffmpeg/core": "^0.9.0",
"@ffmpeg/ffmpeg": "^0.9.8",

import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
const ffmpeg = createFFmpeg({corePath: "/ffmpeg_core_dist/ffmpeg-core.js", log: true });

 const convertVideoFromBytes = async (videoBytes, inputFileName) => {
try {
    await ffmpeg.load();
    const blob = new Blob([videoBytes], { type: 'video/avi' });
    const url = URL.createObjectURL(blob);
    const outputFileName = inputFileName.replace(/\.avi$/, ".mp4");
    if (typeof ffmpeg.current.run === 'function') {
      await ffmpeg.current.run('-i', url, outputFileName);
  } else {
      throw new Error('ffmpeg.run is not a function');
  }
    console.log('Conversion completed successfully');
    URL.revokeObjectURL(url);
    console.log(outputFileName,'outputFileName')
    return outputFileName; 
} catch (error) {
    console.error('Error converting video:', error);
    throw error;
}

};

i am using above versions , and when i use this , await ffmpeg.load(); , its getting like above issue !
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

1 participant