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

"Bad mount point" #181

Open
pcprince opened this issue Jul 7, 2022 · 0 comments
Open

"Bad mount point" #181

pcprince opened this issue Jul 7, 2022 · 0 comments

Comments

@pcprince
Copy link

pcprince commented Jul 7, 2022

I'm attempting to take a PNG or JPG and a WAV file and combine them into a simple video which just displays the static image and plays the audio.

This command works for ffmpeg in the command line and produces a 5 second video:
ffmpeg -loop 1 -y -i "BAT.PNG" -i "BAT.WAV" -c:v libx264 -c:a aac -b:a 48k -pix_fmt yuv420p -t 5000ms out.mp4

I'm trying to do this using ffmpeg.js now. Reading ancient issues on the tracker from 2016, the developer claimed that PNG decoding wasn't included in the module and I couldn't find evidence it had been added since. So I'm just trying with a JPG file and a WAV file now.

I've tried loading the two files in the two different ways listed in the README:

const ffmpeg = require("ffmpeg.js/ffmpeg-mp4.js");
const fs = require("fs");

const audioData = new Uint8Array(fs.readFileSync("BAT.WAV"));
const imageData = new Uint8Array(fs.readFileSync("BAT.JPG"));

const result = ffmpeg({
    MEMFS: [{name: "BAT.JPG", data: imageData}, {name: "BAT.WAV", data: audioData}],
    arguments: ["-loop", "1", "-i", "BAT.JPG", "-i", "BAT.WAV", "-c:v", "libx264", "-c:a", "aac", "-b:a", "48k", "-pix_fmt", "yuv420p", "-t", "7000ms", "soup.mp4"],
});

console.log(result);

and

const ffmpeg = require("ffmpeg.js/ffmpeg-mp4.js");

const result = ffmpeg({
    mounts: [{type: "NODEFS", opts: {root: "."}, mountpoint: "/data"}],
    arguments: ["-loop", "1", "-y", "-i", "/data/BAT.JPG", "-i", "/data/BAT.WAV", "-c:v", "libx264", "-c:a", "aac", "-b:a", "48k", "-pix_fmt", "yuv420p", "-t", "7000ms", "/data/out.mp4"],
});

console.log(result);

Both produce the same "Bad mount point" error:

var c=a.mountpoint;if(!c.match(/^\/[^\/]+$/)||"/."===c||"/.."===c||"/tmp"===c||"/home"===c||"/dev"===c||"/work"===c)throw Error("Bad mount point");

If I remove the image file and only attempt to load the audio, it successfully produces an MP4 file with no visual component. If I remove the WAV file and try to have a silent video with just the image, I get the error.

Any idea what I'm doing wrong with regard to loading in image files?

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