PW Akshay

Generation

generate functionSun, 04 Dec 2022

stream m3u8 url to rtmp in python with pyffmpeg

def stream_to_rtmp(m3u8_path, rtmp_path): from pyffmpeg import FFMPEG ff = FFMPEG(m3u8_path) ff.cmd.extend(['-f', 'flv', '-vcodec', 'copy', '-acodec', 'copy', '-copyts', '-copytb', '0', rtmp_path]) ff.run() stream_to_rtmp('http://m3u8.com/m3u8.m3u8', 'rtmp://rtmp.com/app/stream')

Questions about programming?Chat with your personal AI assistant