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) ## enhance the above code.
def ffmpeg(URL): 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) # get it from user input URL = input("Enter here: /n") ffmpeg(URL)