This application can show a 2x2 grid of video from four cameras. If you want the application to run with a less than four cameras, you can use the -n parameter.
The application also requires that the
board has four connected and configured as CAMERA_UNIT_1,
CAMERA_UNIT_2, CAMERA_UNIT_3, and
CAMERA_UNIT_4.
You can run the Camera MUX 2x2 with these parameters:
- -n numberofcameras
- You can use this optional parameter to run the application using 1–3 cameras.
When this parameter isn't specified, four cameras are required for this
application to run; otherwise it exits.
For example, if you want to run this application with one camera, you would run this command:
camera_mux2x2 -n 1
- -w width
- You can use this optional parameter to run the application and
specify the width of the video feed.
- -h height
- You can use this optional parameter to run the application and
specify the height of the video feed.
- -f framerate
- You can use this optional parameter to run the application and
specify framerate to use.
- -x window_width
- You can use this optional parameter to run the application and
specify the width of the window the frame appears within.
- -y window_height
- You can use this optional parameter to run the application and
specify the height of the window the frame appears within.
- -u enum_of_camera
- You can use this optional parameter to run the application using
the specific camera. For example -u 3 matches
the camera configured as SENSOR_UNIT_2 in the sensor configuration
file.
The 2x2 grid shows an image buffer from each camera starting. The video streams from the cameras start are arranged in the following manner:
- in the top-left corner is SENSOR_UNIT_1 the camera connected to port 0
- in the top-right corner is SENSOR_UNIT_2, the camera connected to port 1
- in the bottom-left corner is SENSOR_UNIT_3, the camera connected to port 2
- in the bottom-right corner is SENSOR_UNIT_4, the camera connected to port 3
Here's what the screen looks like:
Figure 1. Camera MUX 2x2 application
If you have the Camera MUX 2x2 application running, you should stop it before you run other applications. To stop it, use the
slay camera_mux2x2 command.
If you don't have four cameras to connected to your board, you can run this application by using file cameras. For more information about how to configure file cameras, see
Configuration for file cameras.
Run the application
By default, the Camera MUX 2x2 requires four cameras to run. If you don't have four cameras, the application exits
immediately.
- Connect to your board using ssh.
- If the another example application is running, type slay example_app
in your ssh session to stop it (where example_app is
the example application that's running, such as slay adas_example).
The application should stop running (you see a blank display).
- Type the camera_mux2x2 command with the -n 1 option to run the Camera MUX 2x2 application
using one camera.
# camera_mux2x2 -n 1
You should see the default video of a man walking from left to right appear.
Build the Camera MUX 2x2 application
On your host computer, the source code is provided for the Camera MUX 2x2
application as part of a ZIP file. You can build the source and deploy the binary on to your target.
- A ZIP file installed with the QNX Platform for ADAS - Base is
located at installation
directory/source/adas-camera-examples-version.zip.
You must extract it to get the ZIP file for the camera examples.
- In the extraction_directory/source_package_adas_camera
directory,
there's a README.txt that you can follow
to build the application.
- Navigate to
extraction_directory/source_package_adas_camera
/apps/sensor/camera_mux2x2/nto/x86_64/o
and transfer the camera_mux2x2 file to
the /usr/bin/ directory on the target.
For example, you can use the QNX Momentics IDE to transfer the file.
Note: Ensure that you can create a backup of the original
camera_mux2x2 file before you
deploy your newly built version of the Camera MUX 2x2 application.
- On your target, in a terminal connection,
run the Camera MUX 2x2 application.