NAME
video
—
record or display images from
video(4)
SYNOPSIS
video |
[-cdgqRv ]
[-a adaptor]
[-e encoding]
[-f file]
[-i input]
[-O output]
[-o output]
[-r rate]
[-s size]
[control[=value]] |
DESCRIPTION
video
is a utility for reading, writing
and displaying streams of raw video frames. By default frames are read from
file and displayed via
Xv(3). The default
file is /dev/video. If the
-o
option is used frames are read from
file and written to output. If
the -i
option is used frames are read from
input and displayed via
Xv(3). If the
-O
option is used frames are read from
file, written to output and
displayed via Xv(3). The acutance, brightness, contrast, gain, gamma, hue,
saturation and white balance temperature controls of
file can also be adjusted if
file supports these controls.
The options are as follows:
-a
adaptor- Index of Xv(3) adaptor to use. The default is 0, the first adaptor reported by X(7).
-c
- List all current supported control values and quit.
-d
- Reset all supported controls to their default value and quit.
-e
encoding- Lowercase FOURCC name of video encoding to use. Valid arguments are
‘
uyvy
’, ‘yuy2
’ and ‘yv12
’. The default is ‘yuy2
’ unless file is being used and only supports ‘uyvy
’, in which case ‘uyvy
’ will be used by default. -f
file- video(4) device from which frames will be read. The default is /dev/video.
-g
- Use read(2) to grab frames instead of mmap(2).
-i
input- File from which frames will be read. If input is
‘
-
’, frames will be read from standard input. -O
output- File to which frames will be written. If output is
‘
-
’, frames will be written to standard output. In contrast to-o
, if this option is used,video
will also display the frames via Xv(3). -o
output- File to which frames will be written. If output is
‘
-
’, frames will be written to standard output. -q
- Query for encodings, frame sizes/rates, and controls. Display them and quit.
-R
- Disable frame rate adjustment.
-r
rate- Rate in frames per second at which to read. Must be an integer greater
than 0. If the
-r
option is not specified, frames will be read as quickly as possible. If reading from a video(4) device, the device's frame rate will be set to the frame rate the device supports that is closest to rate. Frames will be read as quickly as they are available from the device, but will be displayed and/or written to output at the rate specified, unless the-R
option is used. -s
size- Size of frames to read. The format of size is WxH,
where W represents width and H represents height, both expressed as number
of pixels. The default is 640x480. If size does not
contain ‘
x
’, size is interpreted as only the width. If ‘x
’ is the first character of size, the characters following ‘x
’ are interpreted as the height. If only one of width or height is specified, the other will be calculated using a 4:3 width:height ratio. For example, if given ‘-s 640
’video
will use a size of ‘640x480
’. When reading from a video(4) device and displaying the frames on an Xv(3) display, this option also accepts two special strings, ‘half
’ and ‘full.
’ If either ‘half
’ or ‘full
’ are specified,video
will read frames that are no larger than 2/3 the display width and 2/3 the display height. If ‘full
’ is specified,video
will stretch the frame to the full size of the display using Xv(3) scaling. Ifvideo
is reading frames from a video(4) device and the frame size does not match a frame size the device supports,video
will use the largest frame size supported by the device that is smaller than the specified size. -v
- Verbose mode. Multiple instances of this option are allowed. Each instance increases the level of informational output printed to stderr.
- control[=value]
- Retrieve the specified control, or attempt to set it to value and quit. Multiple control[=value] arguments may be given.
video
will quit reading frames and exit
nicely if it receives any of the following signals: SIGHUP, SIGINT, SIGKILL,
SIGTERM, SIGPIPE.
video
responds to certain key presses
while it is displaying frames. The keypresses are as follows:
A
- Increase acutance (sharpness) control of file.
a
- Decrease acutance (sharpness) control of file.
B
- Increase brightness control of file.
b
- Decrease brightness control of file.
C
- Increase contrast control of file.
c
- Decrease contrast control of file.
f
- Toggle full-screen display.
G
- Increase gain control of file.
g
- Decrease gain control of file.
H
- Increase hue control of file.
h
- Decrease hue control of file.
M
- Increase gamma control of file.
m
- Decrease gamma control of file.
O
- Start writing to output. Only meaningful when the
-O
option is used. o
- Stop writing to output. Only meaningful when the
-O
option is used. p
- Toggle new frame display.
q
- Quit
video
. r
- Reset all supported controls of file to their default value.
S
- Increase saturation control of file.
s
- Decrease saturation control of file.
W
- Increase white balance temperature control of file.
w
- Decrease white balance temperature control of file.
EXAMPLES
The following command will read YUY2 encoded, 640 pixel wide and 480 pixel high video frames from /dev/video and display them using the default Xv(3) adaptor:
$ video
The following command will read YUY2 encoded, 640 pixel wide and 480 pixel high video frames from /dev/video and write them to video.raw at a rate of 15 frames per second:
$ video -r 15 -o
video.raw
The following command will read YUY2 encoded, 640 pixel wide and 480 pixel high video frames from /dev/video, write them to video.raw and display them using the default Xv(3) adaptor at a rate of 15 frames per second:
$ video -r 15 -O
video.raw
The following command will read YUY2 encoded, 640 pixel wide and 480 pixel high video frames from video.raw and display them on the default Xv(3) adaptor at a rate of 15 frames per second:
$ video -r 15 -i
video.raw
Note that with the first three commands, if /dev/video does not support 640x480 pixels sized frames, the largest frame size smaller than 640x480 will be used, and if /dev/video does not support yuy2 encoding, uyvy will be used.