What is Testcamera?
Testcamera is an experimental application that allows users to stream a looped video file to the VMS as an emulated camera. Testcamera 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 Testcamera
<filePath>/testcamera <option> <cameraSet>;<cameraSet2>
-
<option> – the below options
- -I – limit discoverability of testcameras to a specified network interface (for example, to limit the testcameras to your machine: -I=127.0.0.1). See Known Testcamera Limitations below for more information.
- -S – create a separate Testcamera per primary video file
-
<cameraSet> – at least one set of semicolon 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 Testcameras to create, if more than one is needed (for example, count=5)
Example - Create one Testcamera 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
Testcamera is available to download as a separate application on the Integrations Marketplace.
- 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 Testcamera 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 Testcameras from being discovered by other computers on the network
testcamera -I=127.0.0.1 files="hq1.mkv;count=100";secondary-files="lq1.mkv"
Example 2
Create three Testcameras 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 Testcameras from three different source files and prevent the Testcameras 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
Testcamera is included in the server package for all Ubuntu installations.
- Using admin permissions, place any video files you plan on using into /opt/networkoptix/bin/
Note: If you do not have admin permissions to place video files in the same folder as the Testcamera program, you will have to use the full file path of the videos in the cameraSet.
- Open Terminal and navigate to the Testcamera folder:
cd /opt/networkoptix/bin/testcamera
- Run the ./testcamera command with your desired parameters and values.
Example 1
Create 100 identical cameras for performance testing and prevent the Testcameras from being discovered by other computers on the network
./testcamera -I=127.0.0.1 files="hq1.mkv;count=100";secondary-files="lq1.mkv"
Example 2
Create three Testcameras 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 Testcameras from three different source files and prevent the Testcameras 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 Witness, 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 Witness Desktop:
Just select all Testcameras you want to modify (drag across cameras in Nx Witness 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 Testcamera quickly.
Known Testcamera Limitations
- Testcamera loads every file to memory, so using it with a lot of different files requires additional memory.
- Testcamera uses only the first 100 MB of a file
- Testcamera is only compatible with the same version server
- Please, be careful when using Testcamera in a network with several Nx Witness Servers running on the same LAN subnet will discover the Testcamera “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:
Comments
0 comments
Article is closed for comments.