ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
14.56k stars 858 forks source link

No such file or directory Build with -s ASSERTIONS=1 #26

Closed IliasHad closed 4 years ago

IliasHad commented 4 years ago

Describe the bug I run the code in example in my electron app and I change the settings and I got this error

Code

const { createWorker } = require('@ffmpeg/ffmpeg');

const worker = createWorker({
  logger: ({ message }) => console.log(message),
});

async function main() {
  const recorder = aperture();
  console.log('Screens:', await aperture.screens());
  const audioDevice = await aperture.audioDevices()
  console.log('Audio devices:', audioDevice[0].id);

  console.log('Preparing to record for 5 seconds');
  try {
 const load = await worker.load();
  console.log(load);
  const input =   await worker.write('ilias.mp4', path.resolve("/Users/mac/ilias/ilias.mp4"));
  console.log(input)
  const run = await worker.run('-i /data/ilias.mp4 flame.mp4', { input: 'ilias.mp4', output: 'flame.mp4' });
  console.log(run)

}
 catch(err) {

    console.log(err)

  }

}

Error

{
  workerId: 'Worker-0-d79e0',
  jobId: 'Job-0-7ca24',
  message: 'Loaded ffmpeg-core',
  data: undefined
}
{
  workerId: 'Worker-0-d79e0',
  jobId: 'Job-1-fe392',
  message: 'Complete writeFile',
  data: undefined
}
ffmpeg version 0.5.0-5-g092ad14f74 Copyright (c) 2000-2019 the FFmpeg developers
  built with emcc (Emscripten gcc/clang-like replacement) 1.39.0 ((unknown revision))
  configuration: --enable-gpl --enable-libx264 --disable-pthreads --disable-x86asm --disable-inline-asm --disable-doc --disable-stripping --disable-ffprobe --disable-ffplay --disable-ffmpeg --prefix=/workspace/FFmpeg/build --extra-cflags=-I/workspace/FFmpeg/build/include --extra-cxxflags=-I/workspace/FFmpeg/build/include --extra-ldflags=-L/workspace/FFmpeg/build/lib --nm='llvm-nm -g' --ar=emar --cc=emcc --cxx=em++ --objcc=emcc --dep-cc=emcc
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
/data/ilias.mp4: No such file or directory
13
13
abort(13). Build with -s ASSERTIONS=1 for more info.
steveseguin commented 4 years ago

I'm running 0.6.1 in Chrome/Firefox and was getting the Build Assertions error.

index.html:255 Start transcoding
createWorker.js:177 Uncaught Error: abort(13). Build with -s ASSERTIONS=1 for more info.
    at createWorker.js:177
    at Worker.t.onmessage (onMessage.js:3)
index.html:262 Uncaught (in promise) abort(13). Build with -s ASSERTIONS=1 for more info.

The error did not happen when I ran worker.transcode(), but rather just with my worker.run() call.

I resolved the issue by changing my code from await worker.run("-i /data/input.webm to await worker.run("-i input.webm

The /data/ directory requirement mentioned in the docs was misleading.

IliasHad commented 4 years ago

@steveseguin Thank you for your quick reply but it didn't work from me

seoplay commented 4 years ago

I'm getting this issue on the image2video.html example too

seoplay commented 4 years ago

it works if i do what @steveseguin said 🙌