PW Akshay

Generation

generate functionThu, 02 Mar 2023

create a python program to stream video from m3u8 url to youtube using python ffmpeg video streaming modules (do not create function)(do not use subprocess)

import ffmpeg import os import subprocess # Open a video file and recorder the file names # and durations of all the video streams. input = ffmpeg.input('C:\Users\TEMP\Downloads\hls\hls.m3u8') print('Streams:', input.streams.video) # Print the metadata of each video stream. for stream in input.streams.video: print('Metadata:', stream) # Select the first video stream and get its metadata. metadata = input.streams.video[0] # Create an output stream that is a copy of the input stream, # with the same metadata. output = ffmpeg.output(input, metadata, 'output.mkv') # Save the output stream to a file. ffmpeg.run(output)

Questions about programming?Chat with your personal AI assistant