docs/html/structvideoOptions.html
| | Jetson Inference
DNN Vision Library |
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
videoOptions Struct Reference Utilities Library (jetson-utils) » Video Streaming
The videoOptions struct contains common settings that are used to configure and query videoSource and videoOutput streams. More...
#include <videoOptions.h>
|
|
| enum | DeviceType {
DEVICE_DEFAULT = 0, DEVICE_V4L2, DEVICE_CSI, DEVICE_IP,
DEVICE_FILE, DEVICE_DISPLAY
} |
| | Device interface types. More...
|
| |
| enum | IoType { INPUT = 0, OUTPUT } |
| | Input/Output stream type. More...
|
| |
| enum | FlipMethod {
FLIP_NONE = 0, FLIP_COUNTERCLOCKWISE, FLIP_ROTATE_180, FLIP_CLOCKWISE,
FLIP_HORIZONTAL, FLIP_UPPER_RIGHT_DIAGONAL, FLIP_VERTICAL, FLIP_UPPER_LEFT_DIAGONAL,
FLIP_DEFAULT = FLIP_NONE
} |
| | Settings of the flip method used by MIPI CSI cameras and compressed video inputs. More...
|
| |
| enum | Codec {
CODEC_UNKNOWN = 0, CODEC_RAW, CODEC_H264, CODEC_H265,
CODEC_VP8, CODEC_VP9, CODEC_MPEG2, CODEC_MPEG4,
CODEC_MJPEG
} |
| | Video codecs. More...
|
| |
| enum | CodecType {
CODEC_CPU = 0, CODEC_OMX, CODEC_V4L2, CODEC_NVENC,
CODEC_NVDEC
} |
| | Video codec engines. More...
|
| |
|
|
| | videoOptions () |
| | Constructor using default options. More...
|
| |
| void | Print (const char *prefix=NULL) const |
| | Log the video settings, with an optional prefix label. More...
|
| |
| bool | Parse (const char *URI, const int argc, char **argv, IoType ioType, const char *extraFlag=NULL) |
| |
| bool | Parse (const char *URI, const commandLine &cmdLine, IoType ioType) |
| |
| bool | Parse (const int argc, char **argv, IoType ioType, int ioPositionArg=-1) |
| |
| bool | Parse (const commandLine &cmdLine, IoType ioType, int ioPositionArg=-1) |
| |
|
|
| static const char * | IoTypeToStr (IoType type) |
| | Convert an IoType enum to a string. More...
|
| |
| static IoType | IoTypeFromStr (const char *str) |
| | Parse an IoType enum from a string. More...
|
| |
| static const char * | DeviceTypeToStr (DeviceType type) |
| | Convert a DeviceType enum to a string. More...
|
| |
| static DeviceType | DeviceTypeFromStr (const char *str) |
| | Parse a DeviceType enum from a string. More...
|
| |
| static const char * | FlipMethodToStr (FlipMethod flip) |
| | Convert a FlipMethod enum to a string. More...
|
| |
| static FlipMethod | FlipMethodFromStr (const char *str) |
| | Parse a FlipMethod enum from a string. More...
|
| |
| static const char * | CodecToStr (Codec codec) |
| | Convert a Codec enum to a string. More...
|
| |
| static Codec | CodecFromStr (const char *str) |
| | Parse a Codec enum from a string. More...
|
| |
| static const char * | CodecTypeToStr (CodecType codecType) |
| | Convert a CodecType enum to a string. More...
|
| |
| static CodecType | CodecTypeFromStr (const char *str) |
| | Parse a Codec enum from a string. More...
|
| |
|
|
| URI | resource |
| | The resource URI of the device, IP stream, or file/directory. More...
|
| |
| URI | save |
| | Optional path to save the compressed stream to a video file on disk, which is to be used in addition to the primary resource URI above. More...
|
| |
| uint32_t | width |
| | The width of the stream (in pixels). More...
|
| |
| uint32_t | height |
| | The height of the stream (in pixels). More...
|
| |
| float | frameRate |
| | The framerate of the stream (the default is 30Hz). More...
|
| |
| uint64_t | frameCount |
| | The number of frames that have been captured or output on this interface. More...
|
| |
| uint32_t | bitRate |
| | The encoding bitrate for compressed streams (only applies to video codecs like H264/H265). More...
|
| |
| uint32_t | numBuffers |
| | The number of ring buffers used for threading. More...
|
| |
| bool | zeroCopy |
| | If true, indicates the buffers are allocated in zeroCopy memory that is mapped to both the CPU and GPU. More...
|
| |
| int | loop |
| | Control the number of loops for videoSource disk-based inputs (for example, the number of times that a video should loop). More...
|
| |
| int | latency |
| | Number of milliseconds of video to buffer for network RTSP or WebRTC streams. More...
|
| |
| DeviceType | deviceType |
| | Indicates the type of device interface used by this stream. More...
|
| |
| IoType | ioType |
| | Indicates if this stream is an input or an output. More...
|
| |
| FlipMethod | flipMethod |
| | The flip method controls if and how an input frame is flipped/rotated in pre-processing from a MIPI CSI camera or compressed video input. More...
|
| |
| Codec | codec |
| | Indicates the codec used by the stream. More...
|
| |
| CodecType | codecType |
| | Indicates the underlying hardware/software engine used by the codec. More...
|
| |
| std::string | stunServer |
| | URL of STUN server used for WebRTC. More...
|
| |
| std::string | sslCert |
| | Path to a file containing a PEM-encoded SSL/TLS certificate. More...
|
| |
| std::string | sslKey |
| | Path to a file containing a PEM-encoded private key. More...
|
| |
The videoOptions struct contains common settings that are used to configure and query videoSource and videoOutput streams.
| enum videoOptions::Codec |
Video codecs.
| Enumerator |
|---|
| CODEC_UNKNOWN |
Unknown/unsupported codec.
| | CODEC_RAW |
Uncompressed (e.g.
RGB)
| | CODEC_H264 |
H.264.
| | CODEC_H265 |
H.265.
| | CODEC_VP8 |
VP8.
| | CODEC_VP9 |
VP9.
| | CODEC_MPEG2 |
MPEG2 (decode only)
| | CODEC_MPEG4 |
MPEG4 (decode only)
| | CODEC_MJPEG |
MJPEG.
|
| enum videoOptions::CodecType |
Video codec engines.
| Enumerator |
|---|
| CODEC_CPU |
CPU-based implementation using libav (e.g.
avdec_h264 / x264enc)
| | CODEC_OMX |
aarch64 & JetPack 4 only - OMX hardware plugins (e.g.
omxh264dec/omxh264enc)
| | CODEC_V4L2 |
aarch64 & JetPack 5 only - V4L2 hardware plugins (e.g.
nvv4l2decoder/nvv4l2h264enc)
| | CODEC_NVENC |
x86 only - NVENC hardware plugin (not currently implemented)
| | CODEC_NVDEC |
x86 only - NVDEC hardware plugin (not currently implemented)
|
| enum videoOptions::DeviceType |
Device interface types.
| Enumerator |
|---|
| DEVICE_DEFAULT |
Unknown interface type.
| | DEVICE_V4L2 |
V4L2 webcam (e.g.
/dev/video0)
| | DEVICE_CSI |
MIPI CSI camera.
| | DEVICE_IP |
IP-based network stream (e.g.
RTP/RTSP)
| | DEVICE_FILE |
Disk-based stream from a file or directory of files.
| | DEVICE_DISPLAY |
OpenGL output stream rendered to an attached display.
|
| enum videoOptions::FlipMethod |
Settings of the flip method used by MIPI CSI cameras and compressed video inputs.
| Enumerator |
|---|
| FLIP_NONE |
Identity (no rotation)
| | FLIP_COUNTERCLOCKWISE |
Rotate counter-clockwise 90 degrees.
| | FLIP_ROTATE_180 |
Rotate 180 degrees.
| | FLIP_CLOCKWISE |
Rotate clockwise 90 degrees.
| | FLIP_HORIZONTAL |
Flip horizontally.
| | FLIP_UPPER_RIGHT_DIAGONAL |
Flip across upper right/lower left diagonal.
| | FLIP_VERTICAL |
Flip vertically.
| | FLIP_UPPER_LEFT_DIAGONAL |
Flip across upper left/lower right diagonal.
| | FLIP_DEFAULT |
Default setting (none)
|
| enum videoOptions::IoType |
Input/Output stream type.
| Enumerator |
|---|
| INPUT |
Input stream (e.g.
camera, video/image file, ect.)
| | OUTPUT |
Output stream (e.g.
display, video/image file, ect.)
|
| videoOptions::videoOptions | ( | | ) | |
Constructor using default options.
|
| static Codec videoOptions::CodecFromStr | ( | const char * | str | ) | |
| static |
Parse a Codec enum from a string.
|
| static const char* videoOptions::CodecToStr | ( | Codec | codec | ) | |
| static |
Convert a Codec enum to a string.
|
| static CodecType videoOptions::CodecTypeFromStr | ( | const char * | str | ) | |
| static |
Parse a Codec enum from a string.
|
| static const char* videoOptions::CodecTypeToStr | ( | CodecType | codecType | ) | |
| static |
Convert a CodecType enum to a string.
|
| static DeviceType videoOptions::DeviceTypeFromStr | ( | const char * | str | ) | |
| static |
Parse a DeviceType enum from a string.
|
| static const char* videoOptions::DeviceTypeToStr | ( | DeviceType | type | ) | |
| static |
Convert a DeviceType enum to a string.
|
| static FlipMethod videoOptions::FlipMethodFromStr | ( | const char * | str | ) | |
| static |
Parse a FlipMethod enum from a string.
|
| static const char* videoOptions::FlipMethodToStr | ( | FlipMethod | flip | ) | |
| static |
Convert a FlipMethod enum to a string.
|
| static IoType videoOptions::IoTypeFromStr | ( | const char * | str | ) | |
| static |
Parse an IoType enum from a string.
|
| static const char* videoOptions::IoTypeToStr | ( | IoType | type | ) | |
| static |
Convert an IoType enum to a string.
| bool videoOptions::Parse | ( | const char * | URI, | | | | const commandLine & | cmdLine, | | | | IoType | ioType | | | ) | | |
| bool videoOptions::Parse | ( | const char * | URI, |
| | | const int | argc, |
| | | char ** | argv, |
| | | IoType | ioType, |
| | | const char * | extraFlag = NULL |
| | ) | | |
| bool videoOptions::Parse | ( | const commandLine & | cmdLine, |
| | | IoType | ioType, |
| | | int | ioPositionArg = -1 |
| | ) | | |
| bool videoOptions::Parse | ( | const int | argc, |
| | | char ** | argv, |
| | | IoType | ioType, |
| | | int | ioPositionArg = -1 |
| | ) | | |
| void videoOptions::Print | ( | const char * | prefix = NULL | ) | const |
Log the video settings, with an optional prefix label.
| uint32_t videoOptions::bitRate |
The encoding bitrate for compressed streams (only applies to video codecs like H264/H265).
For videoOutput streams, this option can be set from the command line using --bitrate=N.
Notethe default bitrate for encoding output streams is 4Mbps (target VBR).
| Codec videoOptions::codec |
Indicates the codec used by the stream.
This is only really applicable to compressed streams, otherwise it will be CODEC_RAW.
videoSource input streams will attempt to discover the codec type (i.e. from video file), however RTP streams need this to be explitly set using the --input-codec=xyz option (where xyz is a string like h264, h265, vp8, vp9, mpeg2, mpeg4, or mjpeg).
A compressed videoOutput stream will default to H.264 encoding, but can be set using the --output-codec=xyz command line option (same values for xyz as above).
| CodecType videoOptions::codecType |
Indicates the underlying hardware/software engine used by the codec.
For input streams, this can be set with --decode=cpu or --decode=v4l2 for example. For output streams, this can be set with --encode=cpu or --encode=v4l2 for example. The default setting is to use hardware-acceleration on Jetson (aarch64) and CPU on x86.
| DeviceType videoOptions::deviceType |
Indicates the type of device interface used by this stream.
| FlipMethod videoOptions::flipMethod |
The flip method controls if and how an input frame is flipped/rotated in pre-processing from a MIPI CSI camera or compressed video input.
Other types of streams will ignore this.
This option can be set from the command line using --flip-method=xyz, where xyz is one of the strings below:
none (Identity, no rotation)counterclockwise (Rotate counter-clockwise 90 degrees)rotate-180 (Rotate 180 degrees)clockwise (Rotate clockwise 90 degrees)horizontal-flip (Flip horizontally)vertical-flip (Flip vertically)upper-right-diagonal (Flip across upper right/lower left diagonal)upper-left-diagonal (Flip across upper left/lower right diagonal)| uint64_t videoOptions::frameCount |
The number of frames that have been captured or output on this interface.
| float videoOptions::frameRate |
The framerate of the stream (the default is 30Hz).
This option can be set from the command line using --input-rate=N or --output-rate=N for input and output streams, respectively. The --framerate=N option sets it for both.
| uint32_t videoOptions::height |
The height of the stream (in pixels).
This option can be set from the command line using --input-height=N for videoSource streams, or --output-height=N for videoOutput streams.
| IoType videoOptions::ioType |
Indicates if this stream is an input or an output.
| int videoOptions::latency |
Number of milliseconds of video to buffer for network RTSP or WebRTC streams.
The default setting is 10ms (which is lower than GStreamer's default settings). If you have connection/buffering problems, try increasing the latency setting. It can be set from the command line using --input-latency=N or --output-latency=N
| int videoOptions::loop |
Control the number of loops for videoSource disk-based inputs (for example, the number of times that a video should loop).
Other types of streams will ignore it.
The following values are are valid:
-1 = loop forever 0 = don't loop >0 = set number of loops
This option can be set from the command line using --loop=N.
Noteby default, looping is disabled (set to 0).
| uint32_t videoOptions::numBuffers |
The number of ring buffers used for threading.
This option can be set from the command line using --num-buffers=N.
Notethe default number of ring buffers is 4.
| URI videoOptions::resource |
The resource URI of the device, IP stream, or file/directory.
See alsoURI for details about accepted protocols and URI formats.
| URI videoOptions::save |
Optional path to save the compressed stream to a video file on disk, which is to be used in addition to the primary resource URI above.
This option can be set from the command-line using --input-save for videoSource streams, or --output-save for videoOutput streams.
| std::string videoOptions::sslCert |
Path to a file containing a PEM-encoded SSL/TLS certificate.
This is used for enabling HTTPS in the WebRTC server. It can be set from the command-line using the --ssl-cert or --https-cert options. You can make your own self-signed certificate by running a command like: openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
| std::string videoOptions::sslKey |
Path to a file containing a PEM-encoded private key.
This is used for enabling HTTPS in the WebRTC server. It can be set from the command-line using the --ssl-key or --https-key options. You can make your own self-signed certificate by running a command like: openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
| std::string videoOptions::stunServer |
URL of STUN server used for WebRTC.
This can be set using the --stun-server command-line argument. STUN servers are used during ICE/NAT and allow a local device to determine its public IP address. If this is left blank and WebRTC is used, then a default STUN server will be assigned.
| uint32_t videoOptions::width |
The width of the stream (in pixels).
This option can be set from the command line using --input-width=N for videoSource streams, or --output-width=N for videoOutput streams.
| bool videoOptions::zeroCopy |
If true, indicates the buffers are allocated in zeroCopy memory that is mapped to both the CPU and GPU.
Otherwise, the buffers are only accessible from the GPU.
Notethe default is true (zeroCopy CPU/GPU access enabled).
The documentation for this struct was generated from the following file:
jetson-utils/videoOptions.h
Generated on Fri Mar 17 2023 14:29:30 for Jetson Inference by 1.8.17