import aiohttp.web, asyncio, pathlib, uvloop async def main(): app = aiohttp.web.Application() app.add_routes([aiohttp.web.static('/', pathlib.Path(__file__).resolve().parent, show_index=True)]) runner = aiohttp.web.AppRunner(app) await runner.setup() site = aiohttp.web.TCPSite(runner, port=7860) await site.start() while True: ffmpeg = await asyncio.create_subprocess_exec('ffmpeg', '-stream_loop', '-1', '-re', '-i', 'video.mp4', '-c', 'copy', '-f', 'flv', 'rtmp://studio-rtmp.rumble.com/live/s-4nn6tq-lo42-padw-171f72') await ffmpeg.wait() uvloop.run(main())