mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-04-14 01:17:50 +02:00
parent
7bed854ff7
commit
d64633889b
@ -5,6 +5,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import subprocess as sp
|
import subprocess as sp
|
||||||
import threading
|
import threading
|
||||||
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import cv2
|
import cv2
|
||||||
@ -101,6 +102,18 @@ class FFMpegConverter(threading.Thread):
|
|||||||
f"duration {self.frame_times[t_idx + 1] - self.frame_times[t_idx]}"
|
f"duration {self.frame_times[t_idx + 1] - self.frame_times[t_idx]}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try:
|
||||||
|
p = sp.run(
|
||||||
|
self.ffmpeg_cmd.split(" "),
|
||||||
|
input="\n".join(playlist),
|
||||||
|
encoding="ascii",
|
||||||
|
capture_output=True,
|
||||||
|
)
|
||||||
|
except BlockingIOError:
|
||||||
|
logger.warning(
|
||||||
|
f"Failed to create preview for {self.config.name}, retrying..."
|
||||||
|
)
|
||||||
|
time.sleep(2)
|
||||||
p = sp.run(
|
p = sp.run(
|
||||||
self.ffmpeg_cmd.split(" "),
|
self.ffmpeg_cmd.split(" "),
|
||||||
input="\n".join(playlist),
|
input="\n".join(playlist),
|
||||||
|
@ -66,6 +66,7 @@ import {
|
|||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "../ui/dialog";
|
} from "../ui/dialog";
|
||||||
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
type GeneralSettingsProps = {
|
type GeneralSettingsProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
@ -113,13 +114,18 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={className}>
|
|
||||||
<Container>
|
<Container>
|
||||||
<Trigger>
|
<Trigger>
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<TooltipTrigger asChild>
|
<TooltipTrigger asChild>
|
||||||
<div
|
<div
|
||||||
className={`flex flex-col items-center justify-center ${isDesktop ? "cursor-pointer rounded-lg bg-secondary text-secondary-foreground hover:bg-muted" : "text-secondary-foreground"}`}
|
className={cn(
|
||||||
|
"flex flex-col items-center justify-center",
|
||||||
|
isDesktop
|
||||||
|
? "cursor-pointer rounded-lg bg-secondary text-secondary-foreground hover:bg-muted"
|
||||||
|
: "text-secondary-foreground",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<LuSettings className="size-5 md:m-[6px]" />
|
<LuSettings className="size-5 md:m-[6px]" />
|
||||||
</div>
|
</div>
|
||||||
@ -321,9 +327,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
<a href="https://docs.frigate.video">
|
<a href="https://docs.frigate.video">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
className={
|
className={
|
||||||
isDesktop
|
isDesktop ? "cursor-pointer" : "flex items-center p-2 text-sm"
|
||||||
? "cursor-pointer"
|
|
||||||
: "flex items-center p-2 text-sm"
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<LuLifeBuoy className="mr-2 size-4" />
|
<LuLifeBuoy className="mr-2 size-4" />
|
||||||
@ -333,9 +337,7 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
<a href="https://github.com/blakeblackshear/frigate">
|
<a href="https://github.com/blakeblackshear/frigate">
|
||||||
<MenuItem
|
<MenuItem
|
||||||
className={
|
className={
|
||||||
isDesktop
|
isDesktop ? "cursor-pointer" : "flex items-center p-2 text-sm"
|
||||||
? "cursor-pointer"
|
|
||||||
: "flex items-center p-2 text-sm"
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<LuGithub className="mr-2 size-4" />
|
<LuGithub className="mr-2 size-4" />
|
||||||
@ -355,7 +357,6 @@ export default function GeneralSettings({ className }: GeneralSettingsProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Content>
|
</Content>
|
||||||
</Container>
|
</Container>
|
||||||
</div>
|
|
||||||
{restartDialogOpen && (
|
{restartDialogOpen && (
|
||||||
<AlertDialog
|
<AlertDialog
|
||||||
open={restartDialogOpen}
|
open={restartDialogOpen}
|
||||||
|
Loading…
Reference in New Issue
Block a user