forked from Github/frigate
Add API and WebUI to export recordings (#6550)
* Add ability to export frigate clips * Add http endpoint * Add dir to nginx * Add webUI * Formatting * Cleanup unused * Optimize timelapse * Fix pts * Use JSON body for params * Use hwaccel to encode when available * Print ffmpeg command when fail * Print ffmpeg command when fail * Add separate ffmpeg preset for timelapse * Add docs outlining the export directory * Add export docs * Use '' * Fix playlist max time * Lower max playlist time * Add api docs for export * isort fixes
This commit is contained in:
@@ -35,6 +35,7 @@ from frigate.models import Event, Recordings, Timeline
|
||||
from frigate.object_processing import TrackedObject
|
||||
from frigate.plus import PlusApi
|
||||
from frigate.ptz import OnvifController
|
||||
from frigate.record.export import PlaybackFactorEnum, RecordingExporter
|
||||
from frigate.stats import stats_snapshot
|
||||
from frigate.storage import StorageMaintainer
|
||||
from frigate.util import (
|
||||
@@ -1504,6 +1505,22 @@ 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.get_json(silent=True).get("playback", "realtime")
|
||||
exporter = RecordingExporter(
|
||||
current_app.frigate_config,
|
||||
camera_name,
|
||||
int(start_time),
|
||||
int(end_time),
|
||||
PlaybackFactorEnum[playback_factor]
|
||||
if playback_factor in PlaybackFactorEnum.__members__.values()
|
||||
else PlaybackFactorEnum.realtime,
|
||||
)
|
||||
exporter.start()
|
||||
return "Starting export of recording", 200
|
||||
|
||||
|
||||
def imagestream(detected_frames_processor, camera_name, fps, height, draw_options):
|
||||
while True:
|
||||
# max out at specified FPS
|
||||
|
||||
Reference in New Issue
Block a user