Skip to content

Commit

Permalink
Add test with image file used for RTSP stream
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHardiman committed Jul 11, 2022
1 parent ad20804 commit 2f1785b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,15 @@ class Camera {
process.exit(1);
}
if (!fs.existsSync(this.config.CameraDevice)) {
// USB cam is not found
console.log(`USB Camera is not found at ${this.config.CameraDevice}`);
// Filename of image to show in RTSP stream is not found
console.log(`Filesrc file is not found at ${this.config.CameraDevice}`);
process.exit(1);
}
}
if (this.config.CameraType == 'testsrc') {
if (this.config.RTSPServer != 3) {
// Only GStreamer RTSP is supported now
console.log('Only GStreamer RTSP mode is supported for Test Source video');
process.exit(1);
}
}
Expand Down
30 changes: 30 additions & 0 deletions rposConfig.sample-testfile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"NetworkAdapters" : ["awdl0","eth0", "wlan0", "en0"],
"IpAddress" : "192.168.1.185",
"ServicePort" : 8081,
"Username" : "admin",
"Password" : "admin",
"CameraType" : "testsrc",
"CameraDevice" : "",
"RTSPAddress" : "", "//":"Normally left blank. Used to set RTSP Server Address",
"RTSPPort" : 8554,
"RTSPName" : "h264",
"MulticastEnabled" : false, "MulticastEnabledComment" : "## Multicast is not supported for USB camera",
"RTSPMulticastName" : "h264m",
"MulticastAddress" : "224.0.0.1",
"MulticastPort" : "10001",
"RTSPServer" : 3, "RtspServerComment" : "## Select RTSP Server > 1:RPOS RTSP Server 2:V4L2 RTSP Server by mpromonet (auto selected if MulticastEnabled=true) 3:GStreamer",
"PTZDriver" : "pelcod", "PTZDriverComment": "## valid values are none,tenx,pelcod,visca and pan-tilt-hat",
"PTZOutput" : "none", "PTZOutputComment": "## values are none (eg Tenx), serial and tcp",
"PTZSerialPort" : "",
"PTZSerialPortSettings" : { "baudRate":2400, "dataBits":8, "parity":"none", "stopBits":1 },
"PTZOutputURL": "127.0.0.1:9999",
"PTZCameraAddress": 1,
"DeviceInformation" : {
"Manufacturer" : "RPOS Test Card",
"Model" : "Test Card",
"HardwareId" : ""
},
"logLevel" : 3, "logLevelComment": "## LogLevels are > 1:Error 2:Warning 3:Info 4:Debug",
"logSoapCalls" : false
}
Binary file added sample_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f1785b

Please sign in to comment.