Skip to content

Commit

Permalink
Remove duplicate function
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Nov 13, 2022
1 parent 4974340 commit 85baa38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 45 deletions.
38 changes: 0 additions & 38 deletions frigate/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,44 +608,6 @@ def 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>")
def mjpeg_feed(camera_name):
fps = int(request.args.get("fps", "3"))
Expand Down
10 changes: 3 additions & 7 deletions web/src/routes/Debug.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export default function Debug() {
const response = axios.get('vainfo');

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 {
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.' });
}
};

Expand Down Expand Up @@ -125,11 +125,7 @@ export default function Debug() {
<Button className="ml-2" onClick={() => onCopyVainfo()} type="text">
Copy
</Button>
<Button
className="ml-2"
onClick={() => setState({ ...state, vainfo: '', showFfprobe: false })}
type="text"
>
<Button className="ml-2" onClick={() => setState({ ...state, vainfo: '', showFfprobe: false })} type="text">
Close
</Button>
</div>
Expand Down

0 comments on commit 85baa38

Please sign in to comment.