What is Test Camera?
Test Camera is an experimental application that allows users to stream a looped video file to Nx Meta as an emulated camera. Test Camera is launched using a command-line interface (i.e., Terminal, CMD, etc.).
It solves several problems:
- Development: Developers are able to work on integrations without hardware devices (cameras, network gear, etc).
- Debugging: Create a predictable and replicable video stream for testing and debugging video analytics solutions
- Performance testing: Create hundreds of “cameras” to test hardware and software performance and reliability
- Demonstrations: Create a mobile software-only “camera” set to use in demos
Installing and Using Test Camera
<filePath>/testcamera <option> <cameraSet>;<cameraSet2>
- <option> – the below options
- -I – limit discoverability of test cameras to a specified network interface (for example, to limit the test cameras to your machine: -I=127.0.0.1). See Known Testcamera Limitations below for more information.
- -S – create a separate Test Camera per primary video file
- <cameraSet> – at least one set of semi-colon separated parameters, such as below
- files="" – a comma-separated list of video-files for hi-quality/primary streams
- secondary-files="" – a comma-separated list of video-files for low-quality/secondary streams (optional)
- count – number of Test Cameras to create, if more than one is needed (for example, count=5)
Example - Create one Test Camera that can only be discovered by your machine:
C:/testcamera -I=127.0.0.1 files="C:/hq.mkv";secondary-files"lq.mkv";
NOTE: Run the testcamera command with no parameters to access the help function and see the full list of commands.
Windows
Test Camera is available to download as a separate application on MyNx.
- Create a folder in the directory of your choice and name it test_camera (for example, C:\test_camera)
- Download the Testcamera package and extract it to C:\test_camera
- Place any video files you plan on using into C:\test_camera
- Open CMD and navigate to the Test Camera folder:
cd C:/test_camera
- Run the testcamera command with your desired parameters and values.
Example 1: Create 100 identical cameras for performance testing and prevent the Test Cameras from being discovered by other computers on the network
testcamera -I=127.0.0.1 files="hq1.mkv";secondary-files="lq1.mkv";count=100
Example 2: Create three Test Cameras from three different source files
testcamera -S files="hq1.mkv,hq2.mkv,hq3.mkv";secondary-files="lq1.mkv,lq2.mkv,lq3.mkv"
Example 3: Create three Test Cameras from three different source files and prevent the Test Cameras from being discovered by other computers on the network
testcamera -S -I=127.0.0.1 files="hq1.mkv,hq2.mkv,hq3.mkv";secondary-files="lq1.mkv,lq2.mkv,lq3.mkv"
Ubuntu
Test Camera is included in the server package for all Ubuntu installations.
- Using admin permissions, place any video files you plan on using into /opt/networkoptix-meta/mediaserver/bin/
Note: If you do not have admin permissions to place video files in the same folder as the Test Camera program, you will have to use the full file path of the videos in the cameraSet. - Open Terminal and navigate to the Test Camera folder:
cd /opt/networkoptix-meta/mediaserver/bin/testcamera
- Run the ./testcamera command with your desired parameters and values.
Example 1: Create 100 identical cameras for performance testing and prevent the Test Cameras from being discovered by other computers on the network
./testcamera -I=127.0.0.1 files="hq1.mkv";secondary-files="lq1.mkv";count=100
Example 2: Create three Test Cameras from three different source files
./testcamera -S files="hq1.mkv,hq2.mkv,hq3.mkv";secondary-files="lq1.mkv,lq2.mkv,lq3.mkv"
Example 3: Create three Test Cameras from three different source files and prevent the Test Cameras from being discovered by other computers on the network
./testcamera -S -I=127.0.0.1 files="hq1.mkv,hq2.mkv,hq3.mkv";secondary-files="lq1.mkv,lq2.mkv,lq3.mkv"
Best Practices
Use Relevant Files
Create and utilize video files that are similar to the conditions you would like to replicate. The easiest way to get such a sample is to set the real camera to record in Nx Meta, then export a part of the archive.
Adjusting the Frame Rate (FPS)
If you want to change camera frame-per-second (fps) rate, you can modify the frame rate using camera settings in Nx Desktop:
Just select all Test Cameras you want to modify (drag across cameras in Nx Desktop to select multiple), open the Camera Settings Dialog, and adjust the recording schedule to the desired FPS and save to apply the changes.
Quick start
We highly recommended creating an executable script (.bat for Windows, .sh for Linux) for starting Test Camera quickly.
Known Test Camera Limitations
- Test Camera loads every file to memory, so using it with a lot of different files require additional memory.
- Test Camera uses only first 100 MB of a file
- Test Camera is only compatible with the same version server
- Please, be careful when using Test Camera in a network with several powered by Nx products as all Nx Servers running on the same LAN subnet will discover the Test Camera “cameras” and add them to their databases. Use -I key to limit availability by network.
A Few Sample Files
Some files to get you started quickly:
Questions
If you have any questions related to this topic or you want to share your experience with other community members or our team, please visit and engage in our support community or reach out to your local reseller.
Comments
0 comments
Article is closed for comments.