Return full output of ffprobe process

This commit is contained in:
Nick Mowen 2022-11-10 06:40:42 -07:00
parent ff45b6dbe1
commit f294ec1ca1

View File

@ -624,31 +624,31 @@ def ffprobe(camera_name):
if len(config.ffmpeg.inputs) > 1: if len(config.ffmpeg.inputs) > 1:
# user has multiple streams # user has multiple streams
output = "" output = []
for input in config.ffmpeg.inputs: for input in config.ffmpeg.inputs:
output += f"{input.roles}\n"
ffprobe = ffprobe_stream(input.path) ffprobe = ffprobe_stream(input.path)
output.append(
if ffprobe: {
output += f"{ffprobe}\n" "input_roles": input.roles,
else: "return_code": ffprobe.returncode,
output += "error getting stream\n" "stderr": ffprobe.stderr,
"stdout": ffprobe.stdout,
}
)
return jsonify(output, "200") return jsonify(output, "200")
else: else:
# user has single stream # user has single stream
ffprobe = ffprobe_stream(config.ffmpeg.inputs[0].path) ffprobe = ffprobe_stream(config.ffmpeg.inputs[0].path)
if not ffprobe:
return jsonify( return jsonify(
{ {
"success": False, "input_roles": config.ffmpeg.inputs[0].roles,
"message": f"ffprobe unable to get info for {camera_name}", "return_code": ffprobe.returncode,
}, "stderr": ffprobe.stderr,
"500", "stdout": ffprobe.stdout,
}
) )
else:
return jsonify(ffprobe, "200")
@bp.route("/<camera_name>") @bp.route("/<camera_name>")