Test application for video capture
Syntax:
vcapture-test -bsize=dimensions
[-actvid-hsync=actvid]
[-adaptive-dei-int-mode=mode]
[-adaptive-dei-motion-mode=admode]
[-brightness=level]
[-clock-pol=polarity]
[-color-test=colortesttype]
[-contrast=level][-cpos=coordinates]
[-csize=dimensions]
[-data-bus-width=buswidth]
[-device=deviceid]
[-display=displayid][-ddr-clk=clock]
[-dmode=deinterlacemode]
[-edma-chan=channel]
[-fid-pol=polarity][-fill=buffmem]
[-format=bufferformat]
[-frame-count=count][-frame-rate=rate]
[-hsync-pol=polarity][-hue=color]
[-interface-type=itype]
[-nbufs=numbuffers] [-nlanes=lanes]
[-norm=vstandard]
[-zorder=zorder]
[-pipeline=pipelineid]
[-pos=coordinates] [-prio=tpriority]
[-quit-if-no-video] [-saturation=level]
[-save-every-nth=frequency]
[-save-nframes=frames]
[-save-start=frameNumber]
[-sensor-clk-mode=mode]
[-sfsize=dimensions][-size=dimensions]
[-spos=coordinates] [-ssize=dimensions]
[-source=index] [-source-type=sourcetype]
[-sync-type=stype]
[-weave-order=fieldOrder]
[-verbosity] [-video-info=vidinfo]
[-vsync-pol=polarity]
[-zorder=order]
Options:
- -brightness=level
- An integer value in the range of -128–127 that specifies the brightness level to
use for capturing video.
- -bsize=dimensions
- (Required). A pair of integer that specify the dimensions of the buffers. The
dimensions should be delimited by an x. For example
1024x800. The same buffer size is used to capture video and render
display.
- -clock-pol=polarity
- An integer value that controls whether the clock polarity is inverted for capturing
video. You can use the the following values to specify polarity:
- 1 — Polarity is inverted.
- 0 — Polarity is not inverted.
- -1 — Don't set polarity. Use the default polarity set on the camera.
- -color-test=
colortesttype
- An integer value that represents a color test. The colors are tested for the camera.
The color test type can be one of the following values:
- 1 — Test the contrast.
- 2 — Test the brightness.
- 3 — Test the saturation.
- 4 — Test the hue.
- -contrast=level
- An integer value in the range of -128–127 that specifies the level of contrast
to use for capturing video.
- -cpos=coordinates
- A pair of integers that specifies the position to crop the captured video. The
X and Y coordinates are delimited using a
comma(,). For example 10,10.
- -csize=dimensions
- A pair of integers that specifies the crop size to use for the captured video. The
dimensions should be delimited by an x. For example,
790x593.
- -data-bus-width=buswidth
- An integer that specifies the width of the data bus for a parallel interface to use for
capturing video.
- -device=deviceid
- An integer that specifies the index of the device to use for capturing video.
- -display=displayid
- A string that represents a numeric value or a display type. As a numeric value, it's
used to represent the display ID. As a string value , it represents the display type
using one of these values, which are case-sensitive:
- internal
- An internal connection type to the display.
- composite
- A composite connection type to the display.
- svideo
- A S-Video connection type to the display.
- YPbPr
- A component connection type to the display—specifically the YPbPr signal
of the component connection.
- rgb
- A component connection type to the display—specifically the RGB signal of
the component connection.
- rgbhv
- A component connection type to the display—specifically the RBGHV signal
of the component connection.
- dvi
- A DVI connection type to the display.
- hdmi
- An HDMI connection type to the display.
- other
- A connection type to the display which is one other than internal, composite,
S-Video, component, DVI, HDMI, or DisplayPort.
- -dmode=deinterlacemode
- A string that specifies the de-interlace mode to use for the captured video. The
mode can be specified using one of the following values, which are case-sensitive:
- adaptive
- Use motion adapative de-interlacing mode.
Note: For Texas Instruments Jacinto5
and Freescale i.MX6x targets, setting this value causes the motion-adaptive
de-interlacer (hardware) to be used.
- bob
- Use BOB de-interlacing mode.
- bob2
- Use alternate BOB de-interlace mode.
- none
- Don't de-interlace the video. This value is used if this option isn't set.
- weave
- Use WEAVE de-interlace mode.
- weave2
- Use alternate WEAVE de-interlace mode.
- -fid-pol=polarity
- An integer that controls whether the field ID polarity is signal is inverted for captured video.
You can use the the following values to specify polarity:
- 1 — Polarity is inverted.
- 0 — Polarity is not inverted.
- -1 — Don't set polarity. Use the default polarity set on the camera.
- -fill=buffmem
- An integer that specifies what the buffer is initialized with.
- -format=bufferformat
- A string that specifies the buffer format. If this option isn't set, the default
format is yvyu. The format can be specified using one of the following
values, which are case-sensitive:
- rgb888
- RGB888 format.
- uyvy
- UYVY format
- yuy2
- YUY2 format.
- yvyu
- (default) YVYU format.
- -frame-count=count
- An integer that specifies the total frame count to be captured by the camera.
- -frame-rate=rate
- A float that specifies the expected frame rate (in frames per second) for capturing video.
- -hsync-pol=polarity
- An integer that controls whether the horizontal sync polarity is inverted. You can use the the following values to specify polarity:
- 1 — Polarity is inverted.
- 0 — Polarity is not inverted.
- -1 — Don't set polarity. Use the default polarity set on the camera.
- -hue=color
- An integer in the range of -128–127 that specifies the color used for
capturing video.
- -interface-type=itype
- A string that specifies the type of interface used by the camera. The following
values can be used, which are case-sensitive:
- csi2
- The interface is a MIPI CSI2 interface.
- parallel
- The interface is parallel.
- -nbufs=numbuffers
- An integer that specifies the number of buffers created by the application. You
should allocate at least four buffers, but if you are using adaptive de-interlacing mode
(specified using the -dmode option), allocate at least ten buffers.
If this option isn't set, ten buffers are allocated when adaptive de-interlacing is
used, otherwise four buffers are allocated.
- -nlanes=lanes
- An integer that specifies the number of CSI2 data lanes to be used for the camera.
- -norm=vstandard
- A string that specifies to use a National Television System Committee (NTSC), Phase
Alternating Line (PAL), or Sequential Color with Memory (SECAM) video standard. For more
information about:
The video standard to capture video can be specified using these
values, which are case-sensitive:
- NTSC_M_J
- Standard that's used in United States and Japan.
- NTSC_4_43
- A pseudo-color system that transmits NTSC encoding.
- PAL_M
- Video standard that's used in Brazil.
- PAL_B_G_H_I_D
- PAL format used in a majority of countries.
- PAL_COMBINATION_N
- Video standard that's used in Argentina, Paraguay, and Uruguay. The standard is
similiar to PAL-M.
- PAL_60
- Multi-system PAL support.
- SECAM
- Video standard used in France.
- -pipeline=pipelineid
- An integer that specifies the WFD pipeline ID. When an ID is specified, it indicates
to the Screen Graphics Subsystem to use a non-composited layer on the display.
The number of pipelines vary for each hardware platform and its behavior depends on a
number of factors used by Screen. For information about the
use of pipelines for composition, see "Understanding composition"
in the Screen Graphics Subsystem Developer's Guide.
- -pos=coordinates
- A pair of integers that specifies the position of the video window on the display. The
X and Y coordinates are delimited using a
comma(,). For example, 10,10.
- -prio=tpriority
- An integer that specifies the priority of the capture thread relative to the original
thread priority. The default relative priority is +20.
- -quit-if-no-video
- Stop vcapture-test when no video input is detected. Depending on
the decoder that's used, there may be a delay in detecting whether video input has
stopped.
- -reenable-delay=delaytime
- An integer that specifies the delay time (in milliseconds) to enable video capture
after it has stopped capturing the number of frames specified by the
-frame-count option. If this option is not specified when the
-frame-count option is specified, a prompt appears on command line
of the target to click the Enter key to continue video
capture.
- -resmgr
- Indicates that there is communication with an external resource manager (i.e., hd-dec resource
manager).
- -saturation=level
- An integer in the range of -128–127 that specifies the intensity level of
color to use for capturing video.
- -save-every-nth=frequency
- An integer that specifies the frequency that a raw image is saved with after the start
frame. For example, every 100 frames after the start frame.
- -save-nframes=frames
-
An integer that specifies the total number of frames to be saved. Raw images are only
saved when -save-nframes is less than zero. After the frames are
saved, vcapture-test exits.
- -save-start=frameNumber
- An integer that specifies the frame number to begin saving raw images.
- -sfsize=dimensions
- A pair of integers that specifies the dimensions of the source frame that's used for
capturing video. The dimensions should be delimited by an x. For
example, 720x400.
- -size=dimensions
- A pair of integers that specifies the dimensions of the rectangle to show the video
on the display. The dimensons are delimited using an x. For example,
720x400.
- -ssize=dimensions
- A pair of integers that specifiy the dimensions of the source viewport used for the
captured video. The dimensions should be delimited by an x. For
example, 1024x800.
- -source=index
- An integer that specifies the index of the device's video capture unit.
- -spos=coordinates
- A pair of integers that specifies the position of the source viewport. The
X and Y coordinates are delimited using a
comma(,). For example, 10,10.
- -ssize=dimensions
- A pair of integers that specifies the dimensions of the source viewport used for the
captured video. The dimensons are delimited using an x. For example,
1024x800.
- -verbosity
- An integer that specifies the verbosity level for debugging.
- -video-info=vidinfo
- An integer that specifies the number of frames to wait before checking for the video
information, such as NTSC_M_J or PAL_M.
- -vsync-pol=polarity
- An integer that controls whether the vertical sync polarity is inverted.
You can use the the following values to specify polarity:
- 1 — Polarity is inverted.
- 0 — Polarity is not inverted.
- -1 — Don't set polarity. Use the default polarity set on the camera.
- -weave-order=fieldOrder
- A string that specifies the field order for weave deinterlacing; weave order can be
one of:
- tb (always weave top + bottom, possibly dropping an
unexpected first bottom field; default)
- bt (always weave bottom + top, possibly dropping an
unexpected first top field)
- -zorder=order
- An integer that specifies the z-order of the video rendering window.
The following options are available only for specific platforms:
Platform |
Options |
Texas Instruments Jactino 5 |
- -actvid-hsync=actvid
- An integer that specifies to use ACTVID style line capture. A value of
zero or one can be used to specify the ACTVID style. The default is negative
one (-1) when this option isn't set.
- -adaptive-dei-int-mode=mode
- A string that specifies the interpolation mode for the adaptive
de-interlacer. The mode can be specified using one of these values, which are
case-sensitive:
- mode0
- The interpolated field is created by line averaging from the YUV data.
That is, the interpolated line is created by averaging its top and
bottom lines.
- mode1
- The interpolated field is created by averaging pixels from fields
before and after the current field. For example, if the current field is
a top field, the interpolated bottom field is created by averaging
pixels from bottom field pictures before and after the current field.
- mode2
- This mode is an edge assisted interlace mode with edges detected from
the Luma information in the frame window. Luma for missing lines are
interpolated using original Luma along the detected edge. MV from the
MDT module is used to select coefficients from a LUT on how 2D
interpolation from the current field and 3D interpolation from two
fields adjacent to the current fields are blended.
- mode3
- The edge detection method used in this mode is similar to
interpolation mode 2. The only difference is that the edge-directed
interpolation is performed on both Luma and Chroma. Chroma is
interpolated similarly according to the edge vectors obtained based on
Luma information. This value is default if this option isn't
specified.
- -edma-chan=channel
- An integer that specifies the enhanced direct memory access (EDMA) channel
to use WEAVE2 de-interlacing. You can set a board-specific channel or use a
default EDMA channel. Use a range from 0–63 to specify a board-specific
channel; otherwise, use negative one (-1) to specify the default EDMA channel.
When there's no EDMA channel specified, the default channel is used. The
default EDMA channel number is bound to the specific device and source as
follows:
- channel 6 for device 0 and source 0
- channel 7 for device 1 and source 0
- channel 62 for device 0 and source 1
- channel 63 for device 1 and source 1
- -sync-type=stype
- An integer that specifies the synchronization signal type. You can set
from 0–15. Alternatively, set the value to negative one (-1) to use the
default channel.
|
Texas Instruments OMAP4 and OMAP5 |
- -ddr-clk=clock
- An integer value that specifies the dual-data rate clock (Mhz) of the
external CSI2 transmitter.
|
Freescale SABRE i.MX6x |
- -adaptive-dei-motion-mode=admode
- A string that specifies the motion mode for the adaptive de-interlacer.
The mode can be one of the following values, which are case-sensitive:
- low
- Do minimal conversion of interlaced fields to one progressive
frame.
- med
- (Default) Use the default settings converting interlaced fields to a
progressive frame.
- high
- Do as much processing to produce higher image quality. It may
introduce some delays.
- -sensor-clk-mode=mode
- An integer that specifies the sensor clock mode using one of the following
values:
- 0 — Gated clock
- 1 — Non-gated clock.
- 2 — Progressive video interface CCIR 656.
- 3 — Interlaced video interface CCIR 656.
- 4 — Progressive video interface CCIR 1120 using double data
rate.
- 5 — Progressive video using standard data rate.
- 6 — Interlaced video interface CCIR 1120 using double data
rate.
- 7 — Interlaced video interface CCIR 1120 using standard data
rate.
|
The following options are available only for specific video decoders:
Video decoder |
Options |
Analog Devices ADV7x
|
- -source-type=sourcetype
- An integer that specifies the input source type. This option should be set
when you are setting the -source option. You can use the
following source types:
- 0 — Single-ended composite (CVBS).
- 1 — Sequential Color with Memory (SECAM).
- 2 — Component inteface (pCBCr).
- 3 — Differential composite(CVBS).
|
Description:
The vcapture-test utility demonstrates how to use
Screen to display video that is captured using
the Video capture API.
To invoke vcapture-test on your target:
- Ensure that screen is running.
-
Run vcapture-test from a shell.
Examples:
To start video capture with YVYU format, adaptive de-interlace mode using interpolation mode
3, bound to pipeline 4, and video cropping size set to 720x400:
vcapture-test -pipeline=4 -dmode=adaptive
-adaptive-dei-int-mode=mode3 -bsize=720x480 -csize=720x400
To start video capture with UYVY format, without any de-interlacing done,
and bound to pipeline 4:
vcapture-test -format=uyvy -pipeline=4 -dmode=none -bsize=720x240
To convert a raw image into a different image format, you can use a tool such as ffmpeg:
cat uyvy-720x480.raw | ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt uyvy422
-s 720x480 -i pipe:0 -f image2
-vcodec png uyvy-720x480.png