Created a api point to get the video_file_data
This commit is contained in:
@@ -375,6 +375,23 @@ def gen_frames():
|
|||||||
@app.get("/video_feed")
|
@app.get("/video_feed")
|
||||||
async def video_feed():
|
async def video_feed():
|
||||||
return StreamingResponse(gen_frames(), media_type="multipart/x-mixed-replace; boundary=frame")
|
return StreamingResponse(gen_frames(), media_type="multipart/x-mixed-replace; boundary=frame")
|
||||||
|
|
||||||
|
@app.get("/recordings")
|
||||||
|
async def getRecordings():
|
||||||
|
cursor.execute("SELECT * FROM recordings")
|
||||||
|
sensor_data = cursor.fetchall()
|
||||||
|
|
||||||
|
formated_data = []
|
||||||
|
|
||||||
|
for row in sensor_data:
|
||||||
|
formated_data.append({
|
||||||
|
"id": row[0],
|
||||||
|
"timestamp": row[1],
|
||||||
|
"file_path": row[2],
|
||||||
|
})
|
||||||
|
|
||||||
|
return formated_data
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
# @entrypoint
|
# @entrypoint
|
||||||
# @description Starts the FastAPI app server using Uvicorn.
|
# @description Starts the FastAPI app server using Uvicorn.
|
||||||
|
|||||||
Reference in New Issue
Block a user