Remove duplicate function

This commit is contained in:
Nick Mowen 2022-11-13 13:48:52 -07:00
parent 51fe3dde40
commit 67fd039b95
2 changed files with 3 additions and 45 deletions

View File

@ -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"))

View File

@ -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>