PW Akshay


generate functionSun, 04 Dec 2022

stream m3u8 url to rtmp in python using Streamlink

import streamlink from import HLSStream from streamlink.plugins.rtmpdump import RTMPStream import time from datetime import datetime from time import sleep def stream_m3u8(url, path): streams = streamlink.streams(url) stream = HLSStream(streams) with open(path, 'wb') as f: while True: try: time.sleep(1) data = f.write(data) except KeyboardInterrupt: print("Exiting") break stream.close()

Questions about programming?Chat with your personal AI assistant