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)(do not use subprocess)

import ffmpeg_streaming from ffmpeg_streaming import Formats, Bitrate, Representation, Size url = 'https://XXX.m3u8' stream = ffmpeg_streaming.input(url) stream \ .output('rtmp://a.rtmp.youtube.com/live2/XXXXX-XXXX-XXXX-XXXX', format='flv', vcodec='h264', vbitrate=Bitrate(1200, 1200, 'k'), acodec='aac', abitrate=Bitrate(160, 160, 'k'), aspect='16:9', strict='experimental', ) \ .run()

Questions about programming?Chat with your personal AI assistant