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)

# libraries from ffmpeg_streaming import Formats from ffmpeg_streaming import Bitrate from ffmpeg_streaming import Formats from ffmpeg_streaming import Representation from ffmpeg_streaming import Representation from ffmpeg_streaming import Streaming from ffmpeg_streaming import Streaming # url url = "https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd" # video stream from url stream1 = Streaming(url, timeout=10).streams[0] # video creation stream2 = stream1.stream(Representation(128000, 'mp4a.40.2', 'en', 'audio/mp4', 'aac', Bitrate(128000, 128000))) # upload to youtube stream2.output('output.mp4', format=Formats.mp4, audio_bitrate=128000)

Questions about programming?Chat with your personal AI assistant