Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastiaanYN committed Aug 28, 2022
1 parent 2858fbf commit 4218a47
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ Building the project requires several dependencies and steps to be executed. To
DOCKER_BUILDKIT=1 docker build -t ffmpeg-wasi --output . .
```

## Usage
## Examples

You can use any WASI compatible WASM runtime, like `wasmtime` and `wasmer`, to run the binary.

For example, the following command can be used to generate a thumbnail from a video.
Generating a thumbnail from a video.

```sh
cat videos/video-15s.avi | wasmtime ffmpeg.wasm -- -f avi -i - -ss 00:00:02.000 -vframes 1 -c:v png -f image2pipe - > out.png
wasmtime --dir videos ffmpeg.wasm -- -i videos/video-1080p-60fps-2s.mp4 -ss 1 -vframes 1 videos/out.png
```

Converting from one video format to another.

```sh
wasmtime --dir videos ffmpeg.wasm -- -i videos/video-15s.avi -c:v libx264 videos/out.mp4
```

## Encoders
Expand Down

0 comments on commit 4218a47

Please sign in to comment.