mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Use go2rtc for camera config
This commit is contained in:
parent
82bfd8fd5d
commit
0b08c254d3
@ -44,7 +44,7 @@ http {
|
|||||||
keepalive 1024;
|
keepalive 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
upstream go2rtc_api {
|
upstream go2rtc {
|
||||||
server 127.0.0.1:1984;
|
server 127.0.0.1:1984;
|
||||||
keepalive 1024;
|
keepalive 1024;
|
||||||
}
|
}
|
||||||
@ -178,8 +178,16 @@ http {
|
|||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /restream/ {
|
location ~ /restream/(.*)$ {
|
||||||
proxy_pass http://go2rtc_api/;
|
proxy_pass http://go2rtc/api/stream.mp4?src=$1;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "Upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /go2rtc/ {
|
||||||
|
proxy_pass http://go2rtc/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "Upgrade";
|
proxy_set_header Connection "Upgrade";
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import { usePersistence } from '../context';
|
|||||||
import { useCallback, useMemo, useState } from 'preact/hooks';
|
import { useCallback, useMemo, useState } from 'preact/hooks';
|
||||||
import { useApiHost } from '../api';
|
import { useApiHost } from '../api';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
|
import VideoPlayer from '../components/VideoPlayer';
|
||||||
|
|
||||||
const emptyObject = Object.freeze({});
|
const emptyObject = Object.freeze({});
|
||||||
|
|
||||||
@ -93,6 +94,21 @@ export default function Camera({ camera }) {
|
|||||||
|
|
||||||
let player;
|
let player;
|
||||||
if (viewMode === 'live') {
|
if (viewMode === 'live') {
|
||||||
|
if (cameraConfig.restream.enabled) {
|
||||||
|
<VideoPlayer
|
||||||
|
options={{
|
||||||
|
preload: 'auto',
|
||||||
|
autoplay: true,
|
||||||
|
sources: [
|
||||||
|
{
|
||||||
|
src: `${apiHost}/restream/${camera}`,
|
||||||
|
type: 'video/mp4',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}}
|
||||||
|
onReady={() => {}}
|
||||||
|
/>
|
||||||
|
} else {
|
||||||
player = (
|
player = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<div>
|
<div>
|
||||||
@ -100,6 +116,7 @@ export default function Camera({ camera }) {
|
|||||||
</div>
|
</div>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
} else if (viewMode === 'debug') {
|
} else if (viewMode === 'debug') {
|
||||||
player = (
|
player = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user