Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API and WebUI to export recordings #6550

Merged
merged 20 commits into from
Jun 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use JSON body for params
  • Loading branch information
NickM-27 committed Jun 7, 2023
commit 3c752727636ca82f23a291362fd85e93e5a8ebb3
7 changes: 5 additions & 2 deletions frigate/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1507,14 +1507,17 @@ def vod_event(id):

@bp.route("/export/<camera_name>/start/<start_time>/end/<end_time>", methods=["POST"])
def export_recording(camera_name: str, start_time: int, end_time: int):
playback_factor = request.args.get("playback", type=str, default="realtime")
playback_factor = request.get_json(silent=True).get("playback", "realtime")
logger.error(
f"The playback is {playback_factor} and found { PlaybackFactorEnum[playback_factor] if playback_factor in PlaybackFactorEnum.__members__.values() else PlaybackFactorEnum.realtime}"
)
exporter = RecordingExporter(
camera_name,
int(start_time),
int(end_time),
PlaybackFactorEnum[playback_factor]
if playback_factor in PlaybackFactorEnum.__members__.values()
else PlaybackFactorEnum.real_time,
else PlaybackFactorEnum.realtime,
)
exporter.start()
return "Starting export of recording", 200
Expand Down