So im using ffmpeg to resize a video, and this takes a little while so before the code continues i have to wait for the cmd to close. I havent been able to find a solution and i hope someone that actually knows their stuff can teach me a way. im probably just doing something retarded... Anyway i have tried multiple things like using subprocess.Propen() and then using pope() to see when it doesnt return "None" also tried stuff like subprocess.run() with subprocess.CompletedProcess() but i just cant get it to work could someone please care to explain if there is a way to do this and that im just doing it wrong? :)
Here is an example of what I tried
p = subprocess.Popen("start ffmpeg -y -i "+DIR+"/post.mp4 -vf scale="+str(nW)+":"+str(nH)+" "+DIR+"/post_r.mp4", shell=True)
while p.poll() is None:
time.sleep(1)
print("alive")
else:
print("cmd exited")
Also whenever i put shell=False it just breaks instantly and I get this error: FileNotFoundError: [WinError 2] The system cannot find the file specified