You can pass several options to new-video-capture to set capture parameters. Options take the form of lists in which the first item is an "opcode" that identifies the option and the second item is the value for that option. Below is a list of the accepted options which, if not passed, default to the specified values.
The procedure that is returned from new-video-capture is your interface to the capture device. To capture an image, simply call this procedure with no arguments. It will return the captured frame in the form of a byte-sampled Isis image (3 channels for vc-rgb data, 1 channel for vc-grey data) or a list of 2 isis images if capturing vc-yuv data [y-image uv-image].
The returned images are only valid for processing from the time they are returned until the next call to capture a frame. If the data inside must survive longer, copy it to a separate location before making the next capture call.
This example creates continuous live video in a window.(set vidcap (new-video-capture)) (set win (easywin-create (vidcap))) (vidcap vc-close)
The following captures YUV format images and displays the separate channels continually in a window.(set framesize [640 480]) (set vidcap (new-video-capture [vc-size framesize])) (set window (win-create [win-size framesize] [win-title "Capture"])) (while True (window [win-put (vidcap)] [win-output]))
(set vidcap (new-video-capture [vc-format vc-yuv])) (set win (win-create [win-size [640 240]])) (while True (begin (set yuvbuf (vidcap)) (win [win-put (yuvbuf 0)] [win-put (isolate-channel 0 (yuvbuf 1)) [320 0]] [win-put (isolate-channel 1 (yuvbuf 1)) [480 0]] [win-output])))
Scripts: | (load "video-capture.isis")
|
Other: | At least one of the following libraries should be
operational: Video for Linux 2 |