Video Options
There are two types of options:
- The options start with Input prefix are used for the camera, such as specifying the image size and pixel format.
- The options start with Output prefix are used for the output video, such as specifying aspect ratio and quality.
These options can be passed in through Object value when calling StartStreaming.
For example:
curl -X PUT -d '{
"StartStreaming": {
"InputImageSize": "640x480",
"OutputVideoQuality": "5"
}
}' http://localhost:59882/api/v2/device/name/hp-w200-01/StartStreaming
Supported Input options:
- InputFps: Ignore original timestamps and instead generate timestamps assuming constant frame rate fps. (default - same as source)
- InputImageSize: Specifies the image size of the camera. The format is
wxh
, for example "640x480". (default - automatically selected by FFmpeg) - InputPixelFormat: Set the preferred pixel format (for raw video). (default - automatically selected by FFmpeg)
Note
If the given option value is not supported by the device, FFmpeg will automatically select the best one supported by the device.
Supported Output options:
- OutputFrames: Set the number of video frames to output. (default - no limitation on frames)
- OutputFps: Duplicate or drop input frames to achieve constant output frame rate fps. (default - same as InputFps)
- OutputImageSize: Performs image rescaling. The format is
wxh
, for example "640x480". (default - same as InputImageSize) - OutputAspect: Set the video display aspect ratio specified by aspect. For example "4:3", "16:9". (default - same as source)
- OutputVideoCodec: Set the video codec. For example "mpeg4", "h264". (default - mpeg4)
- OutputVideoQuality: Use fixed video quality level. Range is an integer number between 1 and 31, with 31 being the worst quality. (default - dynamically set by FFmpeg)
You can also set default values for these options by adding additional attributes to the device resource StartStreaming. The attribute name consists of a prefix "default" and the option name.
For example:
deviceResources:
- name: "StartStreaming"
description: "Start streaming process."
attributes:
{ command: "VIDEO_START_STREAMING",
defaultInputFrameSize: "320x240",
defaultOutputVideoQuality: "31"
}
properties:
valueType: "Object"
readWrite: "W"
Note
It is NOT recommended to set default video options in the predefined device profile (i.e. USB-Camera-General) as they may not be supported by every camera.