PW Akshay

Generation

generate functionTue, 17 Jan 2023

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

import ffmpeg import subprocess # to stream from file or url video_src = 'https://file.m3u8' # to stream to youtube video_dst = 'rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx' command = ['ffmpeg', '-y', '-i', video_src, '-vcodec', 'h264', '-acodec', 'aac', '-f', 'flv', video_dst] subprocess.Popen(command)

Questions about programming?Chat with your personal AI assistant