PW Akshay

Generation

generate functionMon, 05 Dec 2022

Program to stream m3u8 urlto rtmp in python using flumotion-rtmp-server.

from subprocess import Popen import sys import os def stream(): m3u8 = sys.argv[1] stream_key = sys.argv[2] name = sys.argv[3] rtmp_url = 'rtmp://localhost:1935/rtmp/' rtmp_url = rtmp_url + stream_key p = Popen('ffmpeg -i {} -c copy -f flv {}'.format(m3u8, rtmp_url), shell=True) print(p.pid) return p.pid stream()

Questions about programming?Chat with your personal AI assistant