Polyfill for WebCodecs, powered by ffmpeg.wasm
Go to file
josephrocca 8920b60dbd
Add unpkg script tag installation example
Helpful for newbies like me who don't use browserify, and didn't realise it was as easy as including a script tag (until I saw the codepen examples).
2020-01-20 14:59:48 +11:00
.github Refactor to remove IDBFS & NODEFS, use Transferable to handle large files 2020-01-13 22:07:47 +08:00
docs Add node version limitation 2020-01-15 00:50:32 +00:00
examples Add node.js concatDemuxer example 2020-01-15 00:34:39 +00:00
scripts Add test 2019-11-06 13:07:12 +00:00
src Remove -c copy in concatDemuxer to be more flexible 2020-01-15 00:49:47 +00:00
tests Use IDBFS and NODEFS to process big file 2019-12-03 22:06:44 +08:00
_config.yml Set theme jekyll-theme-cayman 2019-10-25 19:22:25 +08:00
.eslintrc Add image2video example 2019-11-21 21:31:25 +08:00
.gitattributes Init commit 2019-10-20 22:37:37 +08:00
.gitignore Delete .nyc_output 2019-11-06 13:11:49 +00:00
.gitpod.Dockerfile Update .gitpod.Dockerfile 2019-11-07 07:15:19 +08:00
.gitpod.yml Add test 2019-11-06 13:07:12 +00:00
.npmignore Update .npmignore 2019-11-06 13:10:00 +00:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2019-10-23 14:21:41 +08:00
CONTRIBUTING.md Create CONTRIBUTING.md 2019-10-23 14:22:11 +08:00
LICENSE Create LICENSE 2019-10-23 14:20:17 +08:00
package-lock.json Release v0.6.1 2020-01-15 00:51:07 +00:00
package.json Release v0.6.1 2020-01-15 00:51:07 +00:00
README.md Add unpkg script tag installation example 2020-01-20 14:59:48 +11:00

ffmpeg.js

ffmpeg.js

Node Version Actions Status Maintenance License: MIT Code Style Downloads Total Downloads Month

Use FFmpeg directly in your browser without any backend services!!

Transcode

transcode-demo

codepen

Source Code

Examples:

Name Demo Source Code
Webcam codepen Link

ffmpeg.js provides simple to use APIs, to transcode a video you only need few lines of code:

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

const worker = createWorker();

(async () => {
  await worker.load();
  await worker.write('test.avi', './test.avi');
  await worker.transcode('test.avi', 'test.mp4');
  const { data } = await worker.read('test.mp4');
  fs.writeFileSync('./test.mp4', data);
})();

Installation

$ npm install @ffmpeg/ffmpeg

As we use worker_threads which was introduced in Node.js v10.5.0, please remember to add --experimental-worker if you are using Node.js v10, and you don't have to add anything if you are using Node.js v12

Or, using a script tag in the browser:

<script src="https://unpkg.com/@ffmpeg/ffmpeg@0.6.0/dist/ffmpeg.min.js"></script>
<script>
  const { createWorker } = FFmpeg;
  ...
</script>

Documentation

Tutorials

Learn how to build ffmpeg.js from stories: