Camera configuration file

The configuration file is used to identify the cameras to use for your system. You can have other cameras physically connected to the board, but the only cameras that the system can use are those identified in this file.

You can configure the settings for one or more cameras connected to your board. The configuration file also defines the cameras that you want to use. For testing purposes, you can simulate a camera by specifying a video file to play.

The configuration for cameras is specified in sections enclosed by begin camera_unit and end camera_unit, where camera_unit is an enumumerated value from camera_unit_t. For information about the camera_unit_t, see the Camera Framework Library in the Camera Developer's Guide. You don't need to start with CAMERA_UNIT_1, but that string can appear in the configuration only once. For example, you could use CAMERA_UNIT_3 to identify your first camera as long as it appears only once in your configuration file.

For example:

    begin CAMERA_UNIT_3
        type = usb
        name = front
        position = 0, 0, 0
        direction = 0, 0, 1
        orientation = 0
        address = -1, -1, -1, -1
    end CAMERA_UNIT_3
You can also apply global parameters to the device that the camera is configured on. This global section is enclosed by begin device and end device. Here's an example:
begin device
    version = QNX Platform for ADAS 1.0
    model = QNX Neutrino
end device

Camera-specific parameters:

These are the required and optional parameters that you can use to configure a camera for your system. You can't use these parameters as global settings. The name, position, direction and orientation specified for each are useful when an application wants to know more information about the camera. To get this information, an application can call camera_get_location_property() to retrieve the values.
type
(Required) The type of camera. The values for the supported cameras are as follows:
  • usb: Indicates that the camera is connected to the system via a USB interface. Cameras should be compliant to USB Video Class (UVC).
  • sensor: Indicates that the camera sensor is directly connected to a native video port on the board, such as CSI2.
  • file: Simulates a camera connected to the board. This is useful for testing purposes during the development phase of your project. It plays a video file in a loop.
name
(Required) A unique string to identify the camera.
position
(Optional) A vector coordinate (X,Y,Z) to identify where the camera is located on the device to help you identify it.
direction
(Optional) A vector coordinate (X,Y,Z) representing the direction that the camera is pointing. This parameter is similar to position, but is useful to let users know the direction that the camera is pointing.
orientation
(Optional) The angle, in degrees (0–360), at which the camera is mounted on the device.
address
(Required) Depending on the type of camera that's connected, this parameter is used to refine the identity of the camera, especially in systems where you have more than one camera of the similar type connected to your system. For example, if you have more than one USB camera connected, this parameter can help to identify which one is currently in use.
Based on camera configured for type, here are the formats you should use:
Type Format for address  
usb bus, device, vendorID, deviceID This format is necessary to identify the camera when you have more than one USB camera connected your system. You can use a wildcard (-1) to accept any USB camera found on the system. If you have only one USB camera, using a wildcard value of -1 for all fields correctly works, however, if you have more than one USB camera, you must specify non-wildcard values for at least the bus/device parameter pair or vendorID/deviceID. For example, if you have more than one cameras of the same make/model, you must specify the bus and device because specifying vendorID/deviceID parameter doesn't uniquely identify a camera.
  • The bus and device values are unique and are dependent on where you connect the USB cable on your hardware. The values are useful to describe the position of the device on the USB bus. It's up to you to determine how this is relevant to your system.
  • vendorID and deviceID identify the make and model of the camera. The numbers are specified using the USB standard, therefore you can use it to specify the USB camera to use.
sensor bus, device, vendorID, deviceID This format is necessary to identify the sensor camera when you have more than one camera connected to the sysytem. The format is used to identify the sensor camera where:
  • cameraId—A string that identifies the sensor camera to use. You can use the value of ov10635 (for a camera connected to the Vision board via a parallel port) or ov10635_deser (for cameras connected to a deserializer board using FPD Link III interfaces).
  • input—A number that specifies the camera to use for deserializer boards. Set to 0 for the first camera, 1 for the second camera, etc.
file /path/to/file/video.mp4 This format must be used to specify the path to an MP4 file. The file should be H.264-encoded.
usb_driver_path
(Optional) This parameter is for USB cameras only. It specifies the path of the USB driver. If this parameter isn't specified, /dev/io-usb/io-usb is used.
i2c_addr
(Optional) This parameter is for sensor cameras only. It specifies the 7-bit I2C address used to communicate with the sensor camera. If this parameter isn't specified, the default value for that sensor camera is used.
i2c_path
(Optional) This parameter is for sensor cameras only. It specifies the path of the I2C driver used to communicate with this camera. For example, /dev/i2c1.
playback_group
(For file cameras only) Permits synchronized playback of the specified video file. You can configure multiple cameras to be part of the same group. A value of 0 indicates that the camera isn't part of a group, a value of 1 indicates that the camera is part of group 1, etc. Up to four groups are supported.
flicker_cancel_mode flicker_mode
(Optional) This parameter is for cameras that support 50 or 60 Hz flicker cancellation. The value of flicker_mode can be one of the following:
  • off: (Default) Flicker-cancellation algorithm is off.
  • on_auto: Flicker-cancellation algorithm is on and automatically detects whether 50 or 60 Hz frequency is used.
  • on_50Hz: Flicker-cancellation algorithm is turned on to filter out 50 Hz flicker.
  • on_60Hz: Flicker-cancellation algorithm is turned on to filter out 60 Hz flicker.

Global parameters:

You can use the following parameters as global settings. You can't use these settings as camera-specific settings.
version
(Optional) A string that describes the version of the software on the system.
model
(Optional) A string that describes the name of the software on the system.

Example: Camera configuration file for parallel camera

This sample configuration file is for a camera connected to a board via the parallel port.

The address parameter is set to ov10635, 0 and the i2c_path parameter is set to the location of the path used to communicate with the camera, which is /dev/i2c1 as follows:
begin CAMERA_UNIT_1
    type = sensor
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = ov10635, 0
    i2c_path = /dev/i2c1
end CAMERA_UNIT_1

begin device
    version = QNX Platform for ADAS 1.0
    model = QNX Neutrino
end device

Example: Camera configuration file for FPD Link III

This configuration file is for multiple cameras connected to a deserializer board using an FPD Link III interfaces.

When you connect more than one camera, each camera's configuration for the address should match the port. For FPD Link III interfaces, the address parameter should be set to ov10635_deser, [port number of sensor camera] and the i2c_path parameter should be set to the location of the path used to communicate with the camera, which is /dev/i2c1 as follows:

begin CAMERA_UNIT_1
    type = sensor
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = ov10635_deser, 0
    i2c_path = /dev/i2c1
end CAMERA_UNIT_1

begin CAMERA_UNIT_2
    type = sensor
    name = rear
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = ov10635_deser, 1
    i2c_path = /dev/i2c1
end CAMERA_UNIT_2

begin CAMERA_UNIT_3
    type = sensor
    name = left
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = ov10635_deser, 2
    i2c_path = /dev/i2c1
end CAMERA_UNIT_3

begin CAMERA_UNIT_4
    type = sensor
    name = right
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = ov10635_deser, 3
    i2c_path = /dev/i2c1
end CAMERA_UNIT_4

begin device
    version = QNX Platform for ADAS 1.0
    model = QNX Neutrino
end device       

Example: Camera configuration file for USB camera

The following configuration file is for one USB camera connected the board.

When there's only one USB camera connected to the board, you can use wildcards in the address parameter, which are denoted by four -1 values.
begin CAMERA_UNIT_1
    type = usb
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = -1, -1, -1, -1
end CAMERA_UNIT_1

begin device
    version = QNX Platform for ADAS 1.0
    model = QNX Neutrino
end device

Example: Camera configuration for two USB cameras

This is a configuration file for two USB cameras connected to the board.

When you have more than one USB camera connected to the board, you must specify the bus and device fields in the address property. In addition, the bus field must be unique. For example, on a Jacinto 6 EVM board, if CAMERA_UNIT_1 is connected to the USB 2.0 port and CAMERA_UNIT_2 is connected to the USB 3.0 port, your camera configuration would look like this:
begin CAMERA_UNIT_1
    type = usb
    usb_driver_path = /dev/io-usb/io-usb
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = 1, 1, -1, -1
end CAMERA_UNIT_1

begin CAMERA_UNIT_2
    type = usb
    usb_driver_path = /dev/io-usb/io-usb
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = 0, 1, -1, -1
end CAMERA_UNIT_2

Example: Camera configuration for file camera

This is a configuration file for file cameras. File cameras aren't real cameras, but a configuration that plays a video.

In this example, the MP4 files reside on the target. You camera application must have access to the files that you configure as follows:
begin CAMERA_UNIT_1
    type = file
    name = front
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = /accounts/1000/shared/videos/frontviewvideo1.mp4
end CAMERA_UNIT_1

begin CAMERA_UNIT_2
    type = file
    name = rear
    position = 0, 0, 0
    direction = 0, 0, 1
    orientation = 0
    address = /accounts/1000/shared/videos/rearviewvideo2.mp4
end CAMERA_UNIT_2

begin device
    version = QNX Platform for ADAS 1.0
    model = QNX Neutrino
end device