question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ffmpeg.run: No such file or directory (nodejs)

See original GitHub issue

Describe the bug When executing ffmpeg.run in NodeJS I get a No such file or directory for a absolute file path:

memory mediaserver_wasm.js 
[info] use ffmpeg.wasm v0.9.5
[info] load ffmpeg-core
[info] loading ffmpeg-core
[info] fetch ffmpeg.wasm-core script from @ffmpeg/core
[info] ffmpeg-core loaded
[info] run ffmpeg command: -i /audio/myaudio.mp3
[fferr] ffmpeg version v0.8.4 Copyright (c) 2000-2020 the FFmpeg developers
[fferr]   built with emcc (Emscripten gcc/clang-like replacement) 2.0.8 (d059fd603d0b45b584f634dc2365bc9e9a6ec1dd)
[fferr]   configuration: --target-os=none --arch=x86_32 --enable-cross-compile --disable-x86asm --disable-inline-asm --disable-stripping --disable-programs --disable-doc --disable-debug --disable-runtime-cpudetect --disable-autodetect --extra-cflags='-s USE_PTHREADS=1 -I/src/build/include -O3 --closure 1' --extra-cxxflags='-s USE_PTHREADS=1 -I/src/build/include -O3 --closure 1' --extra-ldflags='-s USE_PTHREADS=1 -I/src/build/include -O3 --closure 1 -L/src/build/lib' --pkg-config-flags=--static --nm=llvm-nm --ar=emar --as=llvm-as --ranlib=emranlib --cc=emcc --cxx=em++ --objcc=emcc --dep-cc=emcc --enable-gpl --enable-nonfree --enable-zlib --enable-libx264 --enable-libx265 --enable-libvpx --enable-libwavpack --enable-libmp3lame --enable-libfdk-aac --enable-libtheora --enable-libvorbis --enable-libfreetype --enable-libopus
[fferr]   libavutil      56. 51.100 / 56. 51.100
[fferr]   libavcodec     58. 91.100 / 58. 91.100
[fferr]   libavformat    58. 45.100 / 58. 45.100
[fferr]   libavdevice    58. 10.100 / 58. 10.100
[fferr]   libavfilter     7. 85.100 /  7. 85.100
[fferr]   libswscale      5.  7.100 /  5.  7.100
[fferr]   libswresample   3.  7.100 /  3.  7.100
[fferr]   libpostproc    55.  7.100 / 55.  7.100
[fferr] /audio/myaudio.mp3: No such file or directory
[ffout] FFMPEG_END

To Reproduce Steps to reproduce the behavior:

const { createFFmpeg, fetchFile } = require('@ffmpeg/ffmpeg');
    const ffmpeg = createFFmpeg({ log: true });
    ffmpeg.load()
    .then(() => {
        ffmpeg.run('-i', '/audio/myaudio.mp3');
    })
    .catch(err => {
        console.error(err);
    })

Expected behavior A clear and concise description of what you expected to happen.

Screenshots

Desktop (please complete the following information):

  • OS: macOS 10.14.5
  • NodeJS: 12.16.1

Smartphone (please complete the following information):

Additional context I have executed the node script like

node --experimental-wasm-threads --experimental-wasm-bulk-memory wasm_example.js

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
loretoparisicommented, Nov 24, 2020

@jeromewu thank you 👍 I was able to make it run:

    const inAudio = 'test.mp3';
    const outAudio = 'test.wav';

    const { createFFmpeg, fetchFile } = require('@ffmpeg/ffmpeg');
    const ffmpeg = createFFmpeg({ log: true });
    ffmpeg.load()
    .then(() => {
        return fetchFile('/root/audio/' + inAudio);
    })
    .then(res => {
        ffmpeg.FS('writeFile', inAudio, res);
        // ffmpeg -y -i /root/audio/test.mp3 -ar 44100 -acodec pcm_s16le /root/audio/test.wav
        const args = [
            '-y',
            '-i',
            inAudio,
            '-ar', '44100',
            '-acodec', 'pcm_s16le',
            outAudio
          ];
        // [info] run ffmpeg command: -y -i test.mp3 -ar 44100 -acodec pcm_s16le test.wav
        return ffmpeg.run.apply(ffmpeg,args);
    })
    .then(res => {
        console.log(res);
        return fs.promises.writeFile('/root/audio/'+outAudio, ffmpeg.FS('readFile', outAudio));
    })
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(err);
    })

Any idea when --experimental-wasm-threads --experimental-wasm-bulk-memory will be merged into node and which version?

Thank you.

1reaction
jeromewucommented, Nov 24, 2020

Any idea when --experimental-wasm-threads --experimental-wasm-bulk-memory will be merged into node and which version?

No idea, I have been waiting for a long time. Haha

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - ffmpeg says that file doesn't exist, but it actually exists
Your .ts file is in transcribation/transcribation.controller.ts but the file you are accessing is not in the same folder.
Read more >
No such file or directory in FFmpeg - Super User
I am in command prompt (in Windows 7) and have the path as C:\Files\ffmpeg (Where ffmpeg is). I run this command line. ffmpeg...
Read more >
Fluent ffmpeg-API for node.js
Fluent-ffmpeg checks for format availability before actually running the command, and throws an error when a specified input format is not available.
Read more >
ffmpeg on EC2 Now With Ubuntu Oh The Pages I Goed Nov ...
Stack Overflow: GitHub: glx.h - No such file or directory libgl1-mesa-dev... Stack Overflow: How do I automate CPAN configuration? Stack ...
Read more >
How to Install FFmpeg on Windows - Adaptive Samples
See how to install (and get started with) FFmpeg on Windows in this ... into wav file but having problem with ffmpeg it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found