PW Akshay

Generation

generate functionSun, 04 Dec 2022

stream m3u8 url to rtmp in python (with pyRTMP)

def stream(url): # Create an RTMPClient instance client = pyrtmp.RTMPClient(sys.argv[2], sys.argv[3], sys.argv[4]) # Connect to the RTMP server if not client.connect(): print('Could not connect to the RTMP server') return # Perform a stream publish if not client.publish(sys.argv[5]): print('Could not publish to the RTMP server') return # Stream the specified file if not client.stream(url): print('Could not stream the file') return stream('http://my.m3u8.url')

Questions about programming?Chat with your personal AI assistant