Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
video_recording_api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikhin.vc
video_recording_api
Commits
08378ba4
Commit
08378ba4
authored
Jan 23, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
0fc5705a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
17 deletions
+24
-17
Dockerfile
Dockerfile
+1
-1
__pycache__/main.cpython-39.pyc
__pycache__/main.cpython-39.pyc
+0
-0
app.py
app.py
+22
-0
main.py
main.py
+1
-16
No files found.
Dockerfile
View file @
08378ba4
...
...
@@ -4,4 +4,4 @@ RUN pip install -r /app/requirements.txt
RUN
apt-get update
&&
apt-get
install
tzdata ffmpeg libsm6 libxext6
-y
ADD
. /app
WORKDIR
/app/
CMD
["python3","main.py"]
\ No newline at end of file
CMD
["python3","app.py"]
\ No newline at end of file
__pycache__/main.cpython-39.pyc
0 → 100644
View file @
08378ba4
File added
app.py
0 → 100644
View file @
08378ba4
from
fastapi
import
FastAPI
from
main
import
Item
from
main
import
video_rec
app
=
FastAPI
()
@
app
.
post
(
"/items/"
)
async
def
create_item
(
item
:
Item
):
# def video_write(self, frame, unique_id):
# frame_width = int(frame.shape[1])
# frame_height = int(frame.shape[0])
item
=
item
.
dict
()
video_rec
(
item
)
if
__name__
==
"__main__"
:
from
uvicorn
import
run
run
(
app
,
host
=
"0.0.0.0"
,
port
=
2328
)
\ No newline at end of file
main.py
View file @
08378ba4
...
...
@@ -32,7 +32,7 @@ def background(f):
@
background
def
video_rec
(
item
):
# size = (640, 480)
working_dir
=
"
/home/administrator/aarti_violation_
videos"
working_dir
=
"videos"
file_name
=
item
[
"name"
]
+
".webm"
file_name
=
os
.
path
.
join
(
working_dir
,
file_name
)
...
...
@@ -76,19 +76,4 @@ def video_rec(item):
video
.
release
()
app
=
FastAPI
()
@
app
.
post
(
"/items/"
)
async
def
create_item
(
item
:
Item
):
# def video_write(self, frame, unique_id):
# frame_width = int(frame.shape[1])
# frame_height = int(frame.shape[0])
item
=
item
.
dict
()
video_rec
(
item
)
if
__name__
==
"__main__"
:
from
uvicorn
import
run
run
(
app
,
host
=
"192.168.3.181"
,
port
=
2328
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment