PW Akshay

Generation

generate functionMon, 05 Dec 2022

live stream m3u8 to rtmp in python

url = 'http://live.3gv.ifeng.com/zixun.m3u8' key = 'fmW4bd8Kj' def live(url,key): import subprocess p = subprocess.Popen(['ffmpeg','-i',url,'-c','copy','-f','flv','rtmp://live.hkstv.hk.lxdns.com/live/'+key],stdout=subprocess.PIPE,stderr=subprocess.PIPE) while p.poll() == None: line = p.stdout.readline() print(line) live(url,key)

Questions about programming?Chat with your personal AI assistant