PW Akshay

Generation

generate functionMon, 05 Dec 2022

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

import rtmpy import time def stream(stream_name, url): """ Function to stream m3u8 url to rtmp """ r = rtmpy.RTMP( rtmp='rtmp://a.rtmp.youtube.com/live2', app='app', playpath=stream_name, swfUrl='http://www.twitch.tv/widgets/live_embed_player.swf?hostname=www.twitch.tv&channel=' + stream_name + '&auto_play=true&start_volume=25', tcUrl='rtmp://a.rtmp.youtube.com/live2', pageUrl='http://www.twitch.tv/' + stream_name, live=True ) r.connect() r.publish(stream_name) r.stream('http://www.twitch.tv/' + stream_name + '/hls/' + url + '.m3u8') time.sleep(5) stream('

Questions about programming?Chat with your personal AI assistant