PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 urlto rtmp in python using FLVStream .

import os from subprocess import Popen, PIPE from threading import Thread from flask import Flask, send_from_directory, Response from flvstreamer import FLVStreamer app = Flask(__name__) def stream_thread(url): flv = FLVStreamer(url) flv.start() @app.route('/') def stream(): url = 'http://' + os.getenv("URL") thread = Thread(target=stream_thread, args=(url,)) thread.start() return Response(flv.stream(), mimetype='text/event-stream')

Questions about programming?Chat with your personal AI assistant