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 video_stream = ffmpeg_streaming.input('https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8') audio_stream = video_stream.audio video_stream = video_stream.video video_stream = video_stream.filter('scale', Size(1280, 720), force_original_aspect_ratio='increase') video_stream = video_stream.filter('pad', Size(1280, 720), Color(0, 0, 0)) video_stream = video_stream.output('test.mp4', format=Formats.mp4, vcodec='libx264', acodec='aac') video_stream.run()

Questions about programming?Chat with your personal AI assistant