mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 09:45:22 +03:00
Remove duplicate function
This commit is contained in:
parent
51fe3dde40
commit
67fd039b95
@ -613,44 +613,6 @@ def stats():
|
|||||||
return jsonify(stats)
|
return jsonify(stats)
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/<camera_name>/ffprobe")
|
|
||||||
def ffprobe(camera_name):
|
|
||||||
if camera_name not in current_app.frigate_config.cameras:
|
|
||||||
return jsonify(
|
|
||||||
{"success": False, "message": f"Camera name {camera_name} not found"}, "404"
|
|
||||||
)
|
|
||||||
|
|
||||||
config: CameraConfig = current_app.frigate_config.cameras[camera_name]
|
|
||||||
|
|
||||||
if len(config.ffmpeg.inputs) > 1:
|
|
||||||
# user has multiple streams
|
|
||||||
output = []
|
|
||||||
|
|
||||||
for input in config.ffmpeg.inputs:
|
|
||||||
ffprobe = ffprobe_stream(input.path)
|
|
||||||
output.append(
|
|
||||||
{
|
|
||||||
"input_roles": input.roles,
|
|
||||||
"return_code": ffprobe.returncode,
|
|
||||||
"stderr": ffprobe.stderr.decode().strip(),
|
|
||||||
"stdout": ffprobe.stdout.decode().strip(),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
return jsonify(output)
|
|
||||||
else:
|
|
||||||
# user has single stream
|
|
||||||
ffprobe: sp.CompletedProcess = ffprobe_stream(config.ffmpeg.inputs[0].path)
|
|
||||||
return jsonify(
|
|
||||||
{
|
|
||||||
"input_roles": config.ffmpeg.inputs[0].roles,
|
|
||||||
"return_code": ffprobe.returncode,
|
|
||||||
"stderr": ffprobe.stderr.decode().strip(),
|
|
||||||
"stdout": ffprobe.stdout.decode().strip(),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/<camera_name>")
|
@bp.route("/<camera_name>")
|
||||||
def mjpeg_feed(camera_name):
|
def mjpeg_feed(camera_name):
|
||||||
fps = int(request.args.get("fps", "3"))
|
fps = int(request.args.get("fps", "3"))
|
||||||
|
|||||||
@ -82,9 +82,9 @@ export default function System() {
|
|||||||
const response = axios.get('vainfo');
|
const response = axios.get('vainfo');
|
||||||
|
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
setState({ ...state, showVainfo: true, vainfo: JSON.stringify(resonse.data, null, 2)})
|
setState({ ...state, showVainfo: true, vainfo: JSON.stringify(resonse.data, null, 2) });
|
||||||
} else {
|
} else {
|
||||||
setState({ ...state, showVainfo: true, vainfo: 'There was an error getting the vainfo output.'})
|
setState({ ...state, showVainfo: true, vainfo: 'There was an error getting the vainfo output.' });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -125,11 +125,7 @@ export default function System() {
|
|||||||
<Button className="ml-2" onClick={() => onCopyVainfo()} type="text">
|
<Button className="ml-2" onClick={() => onCopyVainfo()} type="text">
|
||||||
Copy
|
Copy
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button className="ml-2" onClick={() => setState({ ...state, vainfo: '', showFfprobe: false })} type="text">
|
||||||
className="ml-2"
|
|
||||||
onClick={() => setState({ ...state, vainfo: '', showFfprobe: false })}
|
|
||||||
type="text"
|
|
||||||
>
|
|
||||||
Close
|
Close
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user