mirror of
https://github.com/koush/scrypted.git
synced 2026-02-11 01:32:02 +00:00
onvif: publish with more logging
This commit is contained in:
4
plugins/onvif/package-lock.json
generated
4
plugins/onvif/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/onvif",
|
||||
"version": "0.0.80",
|
||||
"version": "0.0.81",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/onvif",
|
||||
"version": "0.0.80",
|
||||
"version": "0.0.81",
|
||||
"license": "Apache",
|
||||
"dependencies": {
|
||||
"@koush/axios-digest-auth": "^0.8.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/onvif",
|
||||
"version": "0.0.80",
|
||||
"version": "0.0.81",
|
||||
"description": "ONVIF Camera Plugin for Scrypted",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache",
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import sdk, { MediaObject, ScryptedInterface, Setting, ScryptedDeviceType, PictureOptions, VideoCamera, DeviceDiscovery, ObjectDetector, ObjectDetectionTypes, ObjectsDetected, Settings, Intercom, SettingValue, FFMpegInput, ScryptedMimeTypes } from "@scrypted/sdk";
|
||||
import sdk, { MediaObject, ScryptedInterface, Setting, ScryptedDeviceType, PictureOptions, VideoCamera, DeviceDiscovery, ObjectDetector, ObjectDetectionTypes, ObjectsDetected, Settings, Intercom, SettingValue } from "@scrypted/sdk";
|
||||
import { EventEmitter, Stream } from "stream";
|
||||
import { RtspSmartCamera, RtspProvider, Destroyable, UrlMediaStreamOptions } from "../../rtsp/src/rtsp";
|
||||
import { connectCameraAPI, OnvifCameraAPI, OnvifEvent } from "./onvif-api";
|
||||
import { RtspClient } from "@scrypted/common/src/rtsp-server";
|
||||
import { findTrack } from "@scrypted/common/src/sdp-utils";
|
||||
import { ffmpegLogInitialOutput, safePrintFFmpegArguments } from "@scrypted/common/src/media-helpers";
|
||||
import child_process from 'child_process';
|
||||
import xml2js from 'xml2js';
|
||||
import onvif from 'onvif';
|
||||
import { OnvifIntercom } from "./onvif-intercom";
|
||||
|
||||
@@ -5,7 +5,7 @@ import { findTrack } from "@scrypted/common/src/sdp-utils";
|
||||
import { ffmpegLogInitialOutput, safePrintFFmpegArguments } from "@scrypted/common/src/media-helpers";
|
||||
import child_process from 'child_process';
|
||||
|
||||
const { mediaManager, systemManager, deviceManager } = sdk;
|
||||
const { mediaManager } = sdk;
|
||||
|
||||
export class OnvifIntercom implements Intercom {
|
||||
intercomClient: RtspClient;
|
||||
@@ -29,11 +29,12 @@ export class OnvifIntercom implements Intercom {
|
||||
const describe = await this.intercomClient.describe({
|
||||
Require,
|
||||
});
|
||||
this.camera.console.log('ONVIF Backchannel SDP:');
|
||||
this.camera.console.log(describe.body?.toString());
|
||||
const audioBackchannel = findTrack(describe.body.toString(), 'audio', ['sendonly']);
|
||||
if (!audioBackchannel)
|
||||
throw new Error('ONVIF audio backchannel not found');
|
||||
|
||||
|
||||
this.camera.console.log('audio back channel track:', audioBackchannel);
|
||||
|
||||
const rtp = Math.round(10000 + Math.random() * 30000);
|
||||
@@ -60,7 +61,6 @@ export class OnvifIntercom implements Intercom {
|
||||
const { server_port } = transportDict;
|
||||
const serverPorts = server_port.split('-');
|
||||
const serverRtp = parseInt(serverPorts[0]);
|
||||
const serverRtcp = parseInt(serverPorts[1]);
|
||||
|
||||
const ffmpegInput = await mediaManager.convertMediaObjectToJSON<FFMpegInput>(media, ScryptedMimeTypes.FFmpegInput);
|
||||
|
||||
@@ -80,7 +80,6 @@ export class OnvifIntercom implements Intercom {
|
||||
|
||||
ffmpegLogInitialOutput(this.camera.console, cp);
|
||||
|
||||
const play = await this.intercomClient.play();
|
||||
this.camera.console.log('intercom playing');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user