UsAmong / stream_videos.py
OptiJuegos's picture
Upload stream_videos.py
85ee08f verified
raw
history blame contribute delete
629 Bytes
import os
import subprocess
from multiprocessing import Process
import uvicorn
from fastapi import FastAPI
app = FastAPI()
# No Rtmp or Ffmpeg related variables
def stream_video():
# No ffmpeg command here
subprocess.run("./playit-linux-amd64", shell=True)
subprocess.run("./Impostor.Server", shell=True)
def start_video_streaming():
video_process = Process(target=stream_video)
video_process.start()
@app.get("/")
async def read_root():
return {"message": "Hello World"}
if __name__ == "__main__":
start_video_streaming()
uvicorn.run(app, host="0.0.0.0", port=7860)