Camera MUX 2x2

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: 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, seeConfiguration 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.
  1. Connect to your board using ssh.
  2. 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).
  3. 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.

  1. 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.
  2. In the extraction_directory/source_package_adas_camera directory, there's a README.txt that you can follow to build the application.
  3. 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.
  4. On your target, in a terminal connection, run the Camera MUX 2x2 application.