PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 url to rtmp in python using RTMPDump .

import os import subprocess def stream(m3u8_url, rtmp_url): cmd = "rtmpdump --rtmp '{rtmp}' --playpath '{m3u8}' -o '{m3u8}.flv' -v".format(rtmp = rtmp_url, m3u8 = m3u8_url) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) out, err = p.communicate() print out p.kill()

Questions about programming?Chat with your personal AI assistant