PW Akshay

Generation

generate functionTue, 06 Dec 2022

live stream m3u8 to youtube in python using rtmpy

import subprocess import os def runstream(m3u_url): # runs FFMPEG to stream the live m3u8 to youtube # requires ffmpeg installed and environment variable set subprocess.Popen("ffmpeg -re -i " + m3u_url + " -c copy -f flv rtmp://a.rtmp.youtube.com/live2/" + os.getenv("YOUTUBE_STREAM_KEY")) pass runstream("https://mylivestream.com/hls/mystream.m3u8")

Questions about programming?Chat with your personal AI assistant