-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
POC: FastAPI #13615
Open
iursevla
wants to merge
13
commits into
blakeblackshear:dev
Choose a base branch
from
iursevla:fastapi-poc
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
POC: FastAPI #13615
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c50283b
POC: Added FastAPI with one endpoint (get /logs/service)
iursevla dc5f85c
POC: Revert error_log
iursevla 773d211
POC: Converted preview related endpoints to FastAPI
iursevla 93b88e5
POC: Converted two more endpoints to FastAPI
iursevla b83f953
POC: lint
iursevla bcdaf20
Merge branch 'dev' into fastapi-poc
iursevla cb63989
Merge branch 'dev' into fastapi-poc
iursevla 41d6438
Merge branch 'dev' into fastapi-poc
iursevla 30f45fe
Merge branch 'dev' into fastapi-poc
iursevla f414cba
Merge branch 'dev' into fastapi-poc
iursevla b04f693
Merge branch 'dev' into fastapi-poc
iursevla b87fc33
Merge branch 'dev' into fastapi-poc
iursevla aa82e56
Merge branch 'dev' into fastapi-poc
iursevla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from enum import Enum | ||
|
||
|
||
class Tags(Enum): | ||
app = "App" | ||
preview = "Preview" | ||
logs = "Logs" | ||
media = "Media" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import logging | ||
|
||
from fastapi import FastAPI | ||
|
||
from frigate.api import app as main_app | ||
from frigate.api import preview | ||
from frigate.plus import PlusApi | ||
from frigate.ptz.onvif import OnvifController | ||
from frigate.stats.emitter import StatsEmitter | ||
from frigate.storage import StorageMaintainer | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def create_fastapi_app( | ||
frigate_config, | ||
detected_frames_processor, | ||
storage_maintainer: StorageMaintainer, | ||
onvif: OnvifController, | ||
plus_api: PlusApi, | ||
stats_emitter: StatsEmitter, | ||
): | ||
logger.info("Starting FastAPI app") | ||
app = FastAPI(debug=False) | ||
# Routes | ||
app.include_router(main_app.router) | ||
app.include_router(preview.router) | ||
# App Properties | ||
app.frigate_config = frigate_config | ||
app.detected_frames_processor = detected_frames_processor | ||
app.storage_maintainer = storage_maintainer | ||
app.camera_error_image = None | ||
app.onvif = onvif | ||
app.plus_api = plus_api | ||
app.stats_emitter = stats_emitter | ||
|
||
return app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NickM-27 @hawkeye217 @blakeblackshear When you have some time please take a look. Please let me know what you think about this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do, we are currently really busy with ffmpeg 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, @NickM-27, totally understandable. I hope you guys get it working 💯 .
I'll continue working on other endpoints in my free time. I already covered all media endpoints, and today I will convert notification and preview (at least).
So, in short:
Basically dev <- B1 <- B2 <- B3 <- B.....