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)

from ffmpeg_streaming import Formats, Bitrate, Representation, Size import os import sys if len(sys.argv) <= 2: print('Usage: program.py <url> <youtubelive-streamkey>') exit() url = sys.argv[1] stream_key = sys.argv[2] # python program to stream video from m3u8 url to youtube using python-ffmpeg-video-streaming module stream = FFMPEG_Streaming_Video_to_YoutubeLive(url, stream_key, format=Formats.hls, representation=Representation(Size(640, 360), Bitrate(400)), representation=Representation(Size(854, 480), Bitrate(800)), representation=Representation(Size(1280, 720), Bitrate(1600))) stream.start() # to stop the stream stream.stop()

Questions about programming?Chat with your personal AI assistant