mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
System page improvements (#4707)
* Catch case where camera is disabled * Add ffprobe timeout and catch case where camera is disabled
This commit is contained in:
parent
b1ec56de29
commit
43c2761308
@ -1178,6 +1178,11 @@ def ffprobe():
|
|||||||
{"success": False, "message": f"{camera} is not a valid camera."}, "404"
|
{"success": False, "message": f"{camera} is not a valid camera."}, "404"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not current_app.frigate_config.cameras[camera].enabled:
|
||||||
|
return jsonify(
|
||||||
|
{"success": False, "message": f"{camera} is not enabled."}, "404"
|
||||||
|
)
|
||||||
|
|
||||||
paths = map(
|
paths = map(
|
||||||
lambda input: input.path,
|
lambda input: input.path,
|
||||||
current_app.frigate_config.cameras[camera].ffmpeg.inputs,
|
current_app.frigate_config.cameras[camera].ffmpeg.inputs,
|
||||||
|
@ -883,6 +883,8 @@ def ffprobe_stream(path: str) -> sp.CompletedProcess:
|
|||||||
clean_path = escape_special_characters(path)
|
clean_path = escape_special_characters(path)
|
||||||
ffprobe_cmd = [
|
ffprobe_cmd = [
|
||||||
"ffprobe",
|
"ffprobe",
|
||||||
|
"-timeout",
|
||||||
|
"1000000",
|
||||||
"-print_format",
|
"-print_format",
|
||||||
"json",
|
"json",
|
||||||
"-show_entries",
|
"-show_entries",
|
||||||
|
@ -224,26 +224,26 @@ export default function System() {
|
|||||||
<Tbody>
|
<Tbody>
|
||||||
<Tr key="capture" index="0">
|
<Tr key="capture" index="0">
|
||||||
<Td>Capture</Td>
|
<Td>Capture</Td>
|
||||||
<Td>{cameras[camera]['capture_pid']}</Td>
|
<Td>{cameras[camera]['capture_pid'] || "- "}</Td>
|
||||||
<Td>{cameras[camera]['process_fps']}</Td>
|
<Td>{cameras[camera]['process_fps'] || "- "}</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['capture_pid']]['cpu']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['capture_pid']]?.['cpu'] || "- "}%</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['capture_pid']]['mem']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['capture_pid']]?.['mem'] || "- "}%</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
<Tr key="detect" index="1">
|
<Tr key="detect" index="1">
|
||||||
<Td>Detect</Td>
|
<Td>Detect</Td>
|
||||||
<Td>{cameras[camera]['pid']}</Td>
|
<Td>{cameras[camera]['pid'] || "- "}</Td>
|
||||||
<Td>
|
<Td>
|
||||||
{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)
|
{cameras[camera]['detection_fps']} ({cameras[camera]['skipped_fps']} skipped)
|
||||||
</Td>
|
</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['pid']]['cpu']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['pid']]?.['cpu'] || "- "}%</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['pid']]['mem']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['pid']]?.['mem'] || "- "}%</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
<Tr key="ffmpeg" index="2">
|
<Tr key="ffmpeg" index="2">
|
||||||
<Td>ffmpeg</Td>
|
<Td>ffmpeg</Td>
|
||||||
<Td>{cameras[camera]['ffmpeg_pid']}</Td>
|
<Td>{cameras[camera]['ffmpeg_pid'] || "- "}</Td>
|
||||||
<Td>{cameras[camera]['camera_fps']}</Td>
|
<Td>{cameras[camera]['camera_fps'] || "- "}</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['ffmpeg_pid']]['cpu']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['ffmpeg_pid']]?.['cpu'] || "- "}%</Td>
|
||||||
<Td>{cpu_usages[cameras[camera]['ffmpeg_pid']]['mem']}%</Td>
|
<Td>{cpu_usages[cameras[camera]['ffmpeg_pid']]?.['mem'] || "- "}%</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Tbody>
|
</Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
Loading…
Reference in New Issue
Block a user