PW Akshay


generate functionMon, 05 Dec 2022

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

import time import sys import os import subprocess import signal from rtmpy import RTMP def handler(signum, frame): print "Stop streaming" sys.exit(0) signal.signal(signal.SIGINT, handler) # check for correct number of arguments if len(sys.argv) != 3: print 'Usage: python add rtmp://your_server_address/live/your_stream_key' sys.exit(1) stream = RTMP(sys.argv[1], out=sys.argv[2]) stream.start() while True: time.sleep(1)

Questions about programming?Chat with your personal AI assistant