OptiJuegos commited on
Commit
85ee08f
·
verified ·
1 Parent(s): 7cf55f1

Upload stream_videos.py

Browse files
Files changed (1) hide show
  1. stream_videos.py +26 -0
stream_videos.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+ from multiprocessing import Process
4
+ import uvicorn
5
+ from fastapi import FastAPI
6
+
7
+ app = FastAPI()
8
+
9
+ # No Rtmp or Ffmpeg related variables
10
+
11
+ def stream_video():
12
+ # No ffmpeg command here
13
+ subprocess.run("./playit-linux-amd64", shell=True)
14
+ subprocess.run("./Impostor.Server", shell=True)
15
+
16
+ def start_video_streaming():
17
+ video_process = Process(target=stream_video)
18
+ video_process.start()
19
+
20
+ @app.get("/")
21
+ async def read_root():
22
+ return {"message": "Hello World"}
23
+
24
+ if __name__ == "__main__":
25
+ start_video_streaming()
26
+ uvicorn.run(app, host="0.0.0.0", port=7860)