
V = yt.streams.filter(mime_type="video/mp4", res="1080p", adaptive = True).first().download(filename = "HD1080P.mp4") Userurl = (input("Enter a youtube video URL : ")) I've also tried using diffrent ways to set the path like putting it directly without saving it to a variable, this is getting me crazy please help me with a solution. this is the error i getĪlso, how can i run two ffmpeg commands concurrently to compress the video and add watermark at once without doing it seperately.Everytime i launch the code and set the correct path it gives me this error, I tried including ffmpeg path, uninstalling and installing the library back but no luck. In summary, compressing the video works, adding watermark works, but the last line, the error is from the media_watermarked variable, i'm not sure what i'm doing wrong but it isn't resolving the folder correctly moving the final output to the folder. " -filter_complex \"overlay=main_w-(overlay_w+10) : main_h-(10+overlay_h)\" " + media_watermarked, shell=True) n("ffmpeg -i " + media_out + " -i " + watermark + Media_watermarked = str(compressed + '/w_mv1.mov').replace(" ", "\\ ") #2.add watermark to the video and move it to the compressed folder " -vcodec libx264 -crf 22 " + media_out, shell=True) Media_out = str(dir_path + "/compressed_mv1s.mov").replace(" ", "\\ ") compress the video and store it in the media out folder Watermark = dir_path + '/media/watermark.png'Ĭompressed = str(Path.cwd() / '/media/compressed/')

Vidfile = dir_path + '/media/vids/mv1.mov' below i my folder structure and my scriptsĭir_path = os.path.dirname(os.path.realpath(_file_)) The compression works, the watermark works, but the issue i'm having is that the final output is placed in the root folder, and not in the compressed folder. I'm working on a simple script using ffmpeg, to reduce the size of a video and add watermark to the video, then move the final output into the compressed folder.
