move width/height/fps under detect and make required

also resizes the output from ffmpeg to specified size
This commit is contained in:
Blake Blackshear
2021-08-14 14:18:35 -05:00
parent 0ccf543ec1
commit f3a1c1de0a
7 changed files with 175 additions and 95 deletions

View File

@@ -12,7 +12,8 @@ export default function CameraImage({ camera, onload, searchParams = '', stretch
const canvasRef = useRef(null);
const [{ width: availableWidth }] = useResizeObserver(containerRef);
const { name, width, height } = config.cameras[camera];
const { name } = config.cameras[camera];
const { width, height } = config.cameras[camera].detect;
const aspectRatio = width / height;
const scaledHeight = useMemo(() => {