Here is versions:
node v12.9.1, npm 6.10.2, [email protected]
repo: https://github.com/Kagami/ffmpeg.js
decode.js
code like this:
const fs = require('fs');
const ffmpeg = require('ffmpeg.js');
const testData = new Uint8Array(fs.readFileSync("test/test.webm"));
const result = ffmpeg({
MEMFS: [{ name: "test.webm", data: testData }],
arguments: ["-i", "test.webm", "-hide_banner", "%04d.jpg" ],
});
node decode.js
then I got errors:
[vp8 @ 0x6a9850] Warning: not compiled with thread support, using thread emulation
[vorbis @ 0x6ac650] Warning: not compiled with thread support, using thread emulation
Input #0, matroska,webm, from 'test.webm':
Metadata:
encoder : Lavf56.40.100
Duration: 00:00:03.95, start: 0.000000, bitrate: 798 kb/s
Stream #0:0: Video: vp8, yuv420p, 854x480, SAR 1:1 DAR 427:240, 24 fps, 24 tbr, 1k tbn, 1k tbc (default)
Stream #0:1: Audio: vorbis, 48000 Hz, stereo, fltp (default)
Stream #0:2(eng): Subtitle: webvtt
[NULL @ 0x6ae530] Unable to find a suitable output format for '%04d.jpg'
%04d.jpg: Invalid argument
This is because of the use
npm install ffmpeg.js
.It does not contain
image2
muxer andmjpeg
encoder .So I build with docker and modify makefile:
then make and get the
ffmpeg-webm.js
Test code:
and get:
It works!
Hope it helps you ~