PW Akshay

Generation

generate functionSun, 04 Dec 2022

stream m3u8 url to rtmp in python with pyffmpeg

def stream(url, rtmp): from pyffmpeg import FFmpeg from threading import Thread from time import sleep from sys import exit ff = FFmpeg( inputs={url: None}, outputs={rtmp: '-loglevel panic'} ) try: ff.run() except KeyboardInterrupt: print('\nKeyboardInterrupt') except Exception as e: print('\nException', e) finally: ff.process.kill()

Questions about programming?Chat with your personal AI assistant