PW Akshay

Generation

generate functionSun, 04 Dec 2022

import ffmpeg URL = input("Enter here: /n") stream = ffmpeg.input(URL) stream = ffmpeg.output(stream, 'rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx', format='flv', vcodec="copy", acodec="aac", ac="2", ar="44100", ab="128k", strict="-2", flags="+global_header", bufsize="3000k") ffmpeg.run(stream) ## use some other code instead of ffmpeg.run(stream)

import youtube_dl ydl_opts = { 'format': 'bestvideo+bestaudio/best', 'postprocessors': [{ 'key': 'FFmpegExtractAudio', 'preferredcodec': 'mp3', 'preferredquality': '192', }], } with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['https://www.youtube.com/watch?v=BaW_jenozKc'])

Questions about programming?Chat with your personal AI assistant