How to Capture

How to capture video using wasmVision.

wasmVision can capture video data from a webcam, from data files, or from a stream.

Webcam

Your webcam will probably “just work” on Linux, macOS, or Windows. However, you might need to determine the correct identifier to use. Very typically the ID of “0” is the default camera.

When using wasmVision, this is configured by using the --capture webcam flag. Note that this is the default value for capture.

If you need to use a different webcam other than the default, you can use the --source (-s for short) flag like this:

wasmvision run --capture webcam -s 2 -p hello.wasm

FFMpeg

FFMpeg is very useful to read data from files and streams of different formats.

When using wasmVision, this is configured by using the --capture ffmpeg flag.

To capture from a file using FFMpeg, you can use the --source (-s for short) flag like this:

wasmvision run --capture ffmpeg -s /path/to/video.avi -p hello.wasm

To capture from a UDP stream using FFMpeg, you can use the --source (-s for short) flag like this:

wasmvision run --capture ffmpeg -s udp://127.0.0.1:6789 -p hello.wasm

GStreamer

GStreamer is a multipurpose video processing tool that has its own pipeline to pre or post processing video streams.

To capture from a test pattern created using GStreamer, you can use the --source (-s for short) flag like this:

wasmvision run --capture gstreamer -s "videotestsrc ! videoconvert ! appsink" -p hello.wasm

The following GStreamer plugins are included with wasmVision on Linux systems: