PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to live stream m3u8 to rtmp in python (no ffmpeg and no function)

def m3u8_to_rtmp(m3u8_url, rtmp_url): # m3u8_url = "https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8" # rtmp_url = "rtmp://localhost:1935/live/stream" key_uri = m3u8_url.split("/")[-1] m3u8_dir_path = "./" + key_uri ts_file_list = [] ts_file_name = [] ts_path_list = [] ts_path_name = [] print("key_uri:%s" % key_uri) if not os.path.exists(m3u8_dir_path): os.mkdir(m3u8_dir_path) # print(m3u8_url) r = requests.get(m3u8_url) with open(key_uri, "

Questions about programming?Chat with your personal AI assistant