PW Akshay

Generation

generate functionMon, 05 Dec 2022

live stream m3u8 to rtmp in python (no function)

import subprocess url = 'http://192.168.1.1/hls/test.m3u8' rtmp_url = 'rtmp://192.168.1.1/live/my_stream' ffmpeg = "ffmpeg -i '{}' -vcodec copy -acodec copy -f flv '{}'".format(url, rtmp_url) process = subprocess.Popen(ffmpeg.split(), stdout=subprocess.PIPE) output, error = process.communicate() print(output)

Questions about programming?Chat with your personal AI assistant