@@ -47,25 +47,6 @@ ffmpeg.wasm is a pure Webassembly / Javascript port of FFmpeg. It enables video
4747
4848Check [ HERE] ( https://github.com/ffmpegwasm/ffmpeg.wasm-core#configuration )
4949
50- ---
51-
52- ffmpeg.wasm provides simple to use APIs, to transcode a video you only need few lines of code:
53-
54- ``` javascript
55- const fs = require (' fs' );
56- const { createFFmpeg , fetchFile } = require (' @ffmpeg/ffmpeg' );
57-
58- const ffmpeg = createFFmpeg ({ log: true });
59-
60- (async () => {
61- await ffmpeg .load ();
62- ffmpeg .FS (' writeFile' , ' test.avi' , await fetchFile (' ./test.avi' ));
63- await ffmpeg .transcode (' test.avi' , ' test.mp4' );
64- fs .writeFileSync (' ./test.mp4' , ffmpeg .FS (' readFile' , ' test.mp4' ));
65- process .exit (0 );
66- })();
67- ```
68-
6950## Installation
7051
7152```
@@ -81,13 +62,32 @@ $ node --experimental-wasm-threads --experimental-wasm-bulk-memory transcode.js
8162Or, using a script tag in the browser (only works in Chrome):
8263
8364``` html
84- <script src =" https://unpkg.com/@ffmpeg/ffmpeg@0.8.3 /dist/ffmpeg.min.js" ></script >
65+ <script src =" https://unpkg.com/@ffmpeg/ffmpeg@0.9.0 /dist/ffmpeg.min.js" ></script >
8566<script >
8667 const { createFFmpeg } = FFmpeg;
8768 ...
8869 </script >
8970```
9071
72+ ## Usage
73+
74+ ffmpeg.wasm provides simple to use APIs, to transcode a video you only need few lines of code:
75+
76+ ``` javascript
77+ const fs = require (' fs' );
78+ const { createFFmpeg , fetchFile } = require (' @ffmpeg/ffmpeg' );
79+
80+ const ffmpeg = createFFmpeg ({ log: true });
81+
82+ (async () => {
83+ await ffmpeg .load ();
84+ ffmpeg .FS (' writeFile' , ' test.avi' , await fetchFile (' ./test.avi' ));
85+ await ffmpeg .run (' -i' , ' test.avi' , ' test.mp4' );
86+ fs .writeFileSync (' ./test.mp4' , ffmpeg .FS (' readFile' , ' test.mp4' ));
87+ process .exit (0 );
88+ })();
89+ ```
90+
9191## Multi-threading
9292
9393Multi-threading need to be configured per external libraries, only following libraries supports it now:
@@ -100,10 +100,6 @@ Run it multi-threading mode by default, no need to pass any arguments.
100100
101101Need to pass ` -row-mt 1 ` , but can only use one thread to help, can speed up around 30%
102102
103- ## Examples
104-
105- - With React: https://github.com/ffmpegwasm/react-app
106-
107103## Documentation
108104
109105- [ API] ( https://github.com/ffmpegwasm/ffmpeg.wasm/blob/master/docs/api.md )
0 commit comments