mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-23 15:08:32 +00:00
Merge branch 'port-to-gortsplib' into develop
This commit is contained in:
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Kamera",
|
||||
"description_camera": "Diese Einstellungen sind notwendig um eine Verbindung mit der Kamera herzustellen",
|
||||
"only_h264": "Aktuell werden nur H264 RTSP kompatible Kameras unterstützt",
|
||||
"only_h264": "Aktuell werden nur H264/H265 RTSP kompatible Kameras unterstützt",
|
||||
"rtsp_url": "RTSP URL",
|
||||
"rtsp_h264": "H264 RTSP URL der Kamera",
|
||||
"rtsp_h264": "H264/H265 RTSP URL der Kamera",
|
||||
"sub_rtsp_url": "RTSP url für die Live Übertragung.",
|
||||
"sub_rtsp_h264": "Ergänzende URL der Kamera mit geringerer Auflösung für die Live Übertragung.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Camera",
|
||||
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
|
||||
"only_h264": "Currently only H264 RTSP streams are supported.",
|
||||
"only_h264": "Currently only H264/H265 RTSP streams are supported.",
|
||||
"rtsp_url": "RTSP url",
|
||||
"rtsp_h264": "A H264 RTSP connection to your camera.",
|
||||
"rtsp_h264": "A H264/H265 RTSP connection to your camera.",
|
||||
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
|
||||
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Camera",
|
||||
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
|
||||
"only_h264": "Currently only H264 RTSP streams are supported.",
|
||||
"only_h264": "Currently only H264/H265 RTSP streams are supported.",
|
||||
"rtsp_url": "RTSP url",
|
||||
"rtsp_h264": "A H264 RTSP connection to your camera.",
|
||||
"rtsp_h264": "A H264/H265 RTSP connection to your camera.",
|
||||
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
|
||||
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -98,9 +98,9 @@
|
||||
"camera": {
|
||||
"camera": "Caméra",
|
||||
"description_camera": "Les paramètres de la caméra sont requis pour établir une connexion à la caméra de votre choix.",
|
||||
"only_h264": "Actuellement, seuls les flux RTSP H264 sont pris en charge.",
|
||||
"only_h264": "Actuellement, seuls les flux RTSP H264/H265 sont pris en charge.",
|
||||
"rtsp_url": "URL RTSP",
|
||||
"rtsp_h264": "Une connexion RTSP H264 à votre caméra.",
|
||||
"rtsp_h264": "Une connexion RTSP H264/H265 à votre caméra.",
|
||||
"sub_rtsp_url": "URL RTSP secondaire (utilisé pour le direct)",
|
||||
"sub_rtsp_h264": "Une connexion RTSP secondaire vers le flux basse résolution de votre caméra.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "कैमरा",
|
||||
"description_camera": "आपकी पसंद के कैमरे से कनेक्शन बनाने के लिए कैमरा सेटिंग्स की आवश्यकता होती है।",
|
||||
"only_h264": "वर्तमान में केवल H264 RTSP स्ट्रीम समर्थित हैं।",
|
||||
"only_h264": "वर्तमान में केवल H264/H265 RTSP स्ट्रीम समर्थित हैं।",
|
||||
"rtsp_url": "RTSP URL",
|
||||
"rtsp_h264": "आपके कैमरे से H264 RTSP कनेक्शन।",
|
||||
"rtsp_h264": "आपके कैमरे से H264/H265 RTSP कनेक्शन।",
|
||||
"sub_rtsp_url": "दुसरी RTSP URL (लाइवस्ट्रीमिंग के लिए प्रयुक्त)",
|
||||
"sub_rtsp_h264": "आपके कैमरे के कम रिज़ॉल्यूशन के लिए एक दुसरी RTSP कनेक्शन।",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Videocamera",
|
||||
"description_camera": "Le impostazioni della fotocamera sono necessarie per stabilire una connessione con la videocamera scelta.",
|
||||
"only_h264": "Al momento sono supportati solo streams RTSP H264.",
|
||||
"only_h264": "Al momento sono supportati solo streams RTSP H264/H265.",
|
||||
"rtsp_url": "Url RTSP",
|
||||
"rtsp_h264": "Connessione RTSP H264 alla videocamera.",
|
||||
"rtsp_h264": "Connessione RTSP H264/H265 alla videocamera.",
|
||||
"sub_rtsp_url": "Sub-url RTSP (per lo streaming in diretta)",
|
||||
"sub_rtsp_h264": "URL RTSP supplementare della videocamera con risoluzione inferiore per lo streaming in diretta.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "カメラ",
|
||||
"description_camera": "選択したカメラに接続するには、カメラの設定が必要です。",
|
||||
"only_h264": "現在、H264 RTSP ストリームのみがサポートされています。",
|
||||
"only_h264": "現在、H264/H265 RTSP ストリームのみがサポートされています。",
|
||||
"rtsp_url": "RTSP URL",
|
||||
"rtsp_h264": "カメラへの H264 RTSP 接続。",
|
||||
"rtsp_h264": "カメラへの H264/H265 RTSP 接続。",
|
||||
"sub_rtsp_url": "Sub RTSP url (ライブストリーミングに使用)",
|
||||
"sub_rtsp_h264": "カメラの低解像度へのセカンダリ RTSP 接続。",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Camera",
|
||||
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
|
||||
"only_h264": "Momenteel worden enkel H264 RTSP streams gesupporteerd",
|
||||
"only_h264": "Momenteel worden enkel H264/H265 RTSP streams gesupporteerd",
|
||||
"rtsp_url": "RTSP url",
|
||||
"rtsp_h264": "Een H264 RTSP connectie met jouw camera.",
|
||||
"rtsp_h264": "Een H264/H265 RTSP connectie met jouw camera.",
|
||||
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
|
||||
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Camera",
|
||||
"description_camera": "Camera settings are required to make a connection to your camera of choice.",
|
||||
"only_h264": "Currently only H264 RTSP streams are supported.",
|
||||
"only_h264": "Currently only H264/H265 RTSP streams are supported.",
|
||||
"rtsp_url": "RTSP url",
|
||||
"rtsp_h264": "A H264 RTSP connection to your camera.",
|
||||
"rtsp_h264": "A /H265 RTSP connection to your camera.",
|
||||
"sub_rtsp_url": "Sub RTSP url (used for livestreaming)",
|
||||
"sub_rtsp_h264": "A secondary RTSP connection to the low resolution of your camera.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Câmera",
|
||||
"description_camera": "As configurações da câmera são necessárias para fazer uma conexão com a câmera de sua escolha.",
|
||||
"only_h264": "Atualmente, apenas streams H264 RTSP são suportados.",
|
||||
"only_h264": "Atualmente, apenas streams H264/H265 RTSP são suportados.",
|
||||
"rtsp_url": "Url RTSP",
|
||||
"rtsp_h264": "Uma conexão H264 RTSP para sua câmera.",
|
||||
"rtsp_h264": "Uma conexão H264/H265 RTSP para sua câmera.",
|
||||
"sub_rtsp_url": "Sub RTSP URL(usado para transmissão ao vivo)",
|
||||
"sub_rtsp_h264": "Uma conexão RTSP secundária para a baixa resolução de sua câmera.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "Камера",
|
||||
"description_camera": "Настройки камеры необходимы для установки соединения с выбранной камерой.",
|
||||
"only_h264": "В настоящее время поддерживаются только потоки H264 RTSP.",
|
||||
"only_h264": "В настоящее время поддерживаются только потоки H264/H265 RTSP.",
|
||||
"rtsp_url": "Адрес основного потока RTSP",
|
||||
"rtsp_h264": "Подключение к камере по протоколу H264 RTSP.",
|
||||
"rtsp_h264": "Подключение к камере по протоколу H264/H265 RTSP.",
|
||||
"sub_rtsp_url": "Адрес дополнительного потока RTSP (используется для прямой трансляции)",
|
||||
"sub_rtsp_h264": "Дополнительное RTSP-соединение с низким разрешением камеры.",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -99,9 +99,9 @@
|
||||
"camera": {
|
||||
"camera": "相机",
|
||||
"description_camera": "需要相机设置才能连接到您选择的相机。",
|
||||
"only_h264": "目前仅支持 H264 RTSP 流。",
|
||||
"only_h264": "目前仅支持 H264/H265 RTSP 流。",
|
||||
"rtsp_url": "RTSP 网址",
|
||||
"rtsp_h264": "与摄像机的 H264 RTSP 连接。",
|
||||
"rtsp_h264": "与摄像机的 H264/H265 RTSP 连接。",
|
||||
"sub_rtsp_url": "子 RTSP 网址(用于直播)",
|
||||
"sub_rtsp_h264": "与低分辨率相机的辅助 RTSP 连接。",
|
||||
"onvif": "ONVIF",
|
||||
|
||||
@@ -53,9 +53,9 @@ export const verifyOnvif = (config, onSuccess, onError) => {
|
||||
}
|
||||
},
|
||||
(error) => {
|
||||
const { message } = error;
|
||||
const { data } = error;
|
||||
if (onError) {
|
||||
onError(message);
|
||||
onError(data);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -7,6 +7,9 @@ import './ImageCanvas.css';
|
||||
|
||||
class ImageCanvas extends React.Component {
|
||||
componentDidMount() {
|
||||
this.width = 0;
|
||||
this.height = 0;
|
||||
|
||||
this.loadImage = this.loadImage.bind(this);
|
||||
this.generateRandomTagsDescriptor =
|
||||
this.generateRandomTagsDescriptor.bind(this);
|
||||
@@ -55,14 +58,27 @@ class ImageCanvas extends React.Component {
|
||||
|
||||
const { image } = this.props;
|
||||
this.loadImage(image, (img) => {
|
||||
this.loadData(img);
|
||||
if (this.width !== img.width || this.height !== img.height) {
|
||||
this.width = img.width;
|
||||
this.height = img.height;
|
||||
this.loadData(img);
|
||||
} else {
|
||||
this.editor.addContentSource(img);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const { image } = this.props;
|
||||
this.loadImage(image, (img) => {
|
||||
this.loadData(img);
|
||||
if (this.width !== img.width || this.height !== img.height) {
|
||||
this.width = img.width;
|
||||
this.height = img.height;
|
||||
this.loadData(img);
|
||||
} else {
|
||||
// alert('ok');
|
||||
this.editor.addContentSource(img);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ import {
|
||||
} from '@kerberos-io/ui';
|
||||
import { Link, withRouter } from 'react-router-dom';
|
||||
import { connect } from 'react-redux';
|
||||
import { interval } from 'rxjs';
|
||||
import { send } from '@giantmachines/redux-websocket';
|
||||
import ImageCanvas from '../../components/ImageCanvas/ImageCanvas';
|
||||
import './Settings.scss';
|
||||
import timezones from './timezones';
|
||||
@@ -121,6 +123,7 @@ class Settings extends React.Component {
|
||||
this.onUpdateToggle = this.onUpdateToggle.bind(this);
|
||||
this.onUpdateNumberField = this.onUpdateNumberField.bind(this);
|
||||
this.onUpdateTimeline = this.onUpdateTimeline.bind(this);
|
||||
this.initialiseLiveview = this.initialiseLiveview.bind(this);
|
||||
this.verifyPersistenceSettings = this.verifyPersistenceSettings.bind(this);
|
||||
this.verifyHubSettings = this.verifyHubSettings.bind(this);
|
||||
this.verifyCameraSettings = this.verifyCameraSettings.bind(this);
|
||||
@@ -144,11 +147,18 @@ class Settings extends React.Component {
|
||||
}));
|
||||
this.calculateTimetable(config.timetable);
|
||||
});
|
||||
this.initialiseLiveview();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('keydown', this.escFunction, false);
|
||||
clearInterval(this.interval);
|
||||
|
||||
const { dispatchSend } = this.props;
|
||||
const message = {
|
||||
message_type: 'stop-sd',
|
||||
};
|
||||
dispatchSend(message);
|
||||
}
|
||||
|
||||
onAddRegion(device, id, polygon) {
|
||||
@@ -227,6 +237,24 @@ class Settings extends React.Component {
|
||||
]);
|
||||
}
|
||||
|
||||
initialiseLiveview() {
|
||||
const message = {
|
||||
message_type: 'stream-sd',
|
||||
};
|
||||
const { connected, dispatchSend } = this.props;
|
||||
if (connected) {
|
||||
dispatchSend(message);
|
||||
}
|
||||
|
||||
const requestStreamInterval = interval(2000);
|
||||
this.requestStreamSubscription = requestStreamInterval.subscribe(() => {
|
||||
const { connected: isConnected } = this.props;
|
||||
if (isConnected) {
|
||||
dispatchSend(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
calculateTimetable(timetable) {
|
||||
this.timetable = timetable;
|
||||
if (this.timetable) {
|
||||
@@ -521,8 +549,8 @@ class Settings extends React.Component {
|
||||
loadingHub,
|
||||
} = this.state;
|
||||
|
||||
const { config: c, t } = this.props;
|
||||
const { config, snapshot } = c;
|
||||
const { config: c, t, images } = this.props;
|
||||
const { config } = c;
|
||||
|
||||
const snapshotBase64 = 'data:image/png;base64,';
|
||||
// Determine which section(s) to be shown, depending on the searching criteria.
|
||||
@@ -1160,9 +1188,9 @@ class Settings extends React.Component {
|
||||
</BlockHeader>
|
||||
<BlockBody>
|
||||
<p>{t('settings.conditions.description_regionofinterest')}</p>
|
||||
{config.region && (
|
||||
{config.region && images && images.length > 0 && (
|
||||
<ImageCanvas
|
||||
image={snapshotBase64 + snapshot}
|
||||
image={snapshotBase64 + images[0]}
|
||||
polygons={config.region.polygon}
|
||||
rendered={false}
|
||||
onAddRegion={this.onAddRegion}
|
||||
@@ -2379,6 +2407,8 @@ class Settings extends React.Component {
|
||||
|
||||
const mapStateToProps = (state /* , ownProps */) => ({
|
||||
config: state.agent.config,
|
||||
connected: state.wss.connected,
|
||||
images: state.wss.images,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch /* , ownProps */) => ({
|
||||
@@ -2397,11 +2427,14 @@ const mapDispatchToProps = (dispatch /* , ownProps */) => ({
|
||||
dispatchAddRegion: (id, polygon) => dispatch(addRegion(id, polygon)),
|
||||
dispatchRemoveRegion: (id, polygon) => dispatch(removeRegion(id, polygon)),
|
||||
dispatchUpdateRegion: (id, polygon) => dispatch(updateRegion(id, polygon)),
|
||||
dispatchSend: (message) => dispatch(send(message)),
|
||||
});
|
||||
|
||||
Settings.propTypes = {
|
||||
t: PropTypes.func.isRequired,
|
||||
connected: PropTypes.bool.isRequired,
|
||||
config: PropTypes.objectOf(PropTypes.object).isRequired,
|
||||
images: PropTypes.array.isRequired,
|
||||
dispatchVerifyHub: PropTypes.func.isRequired,
|
||||
dispatchVerifyPersistence: PropTypes.func.isRequired,
|
||||
dispatchGetConfig: PropTypes.func.isRequired,
|
||||
@@ -2412,6 +2445,7 @@ Settings.propTypes = {
|
||||
dispatchRemoveRegion: PropTypes.func.isRequired,
|
||||
dispatchVerifyCamera: PropTypes.func.isRequired,
|
||||
dispatchVerifyOnvif: PropTypes.func.isRequired,
|
||||
dispatchSend: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default withTranslation()(
|
||||
|
||||
Reference in New Issue
Block a user