PW Akshay

Generation

generate functionThu, 02 Mar 2023

create a python program to stream video from m3u8 url to youtube using python-ffmpeg-video-streaming module (do not create function)(do not use subprocess)

import ffmpeg from ffmpeg._run import run_piped, run_async async def stream(source, stream_key): stream_server = 'rtmp://a.rtmp.youtube.com/live2' await run_async( [ ffmpeg.input(source), ffmpeg.output( stream_server, **{ 'c:v': 'copy', 'c:a': 'copy', 'f': 'flv', 'stream_key': stream_key } ) ] )

Questions about programming?Chat with your personal AI assistant