I am trying to run wav2lip locally on my system. When inference.py calls the subprocess it gives me an error.
Error:
Traceback (most recent call last):
File "Wav2Lip\inference.py", line 422, in <module>
main()
File "Wav2Lip\inference.py", line 418, in main
subprocess.run(command, shell=platform.system() != "Windows")
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 493, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 858, in __init__
self._execute_
fileNotDound [Errno 2] No such file or directory
inference.py:
command = [
"ffmpeg",
"-y",
"-i", args.audio,
"-i", args.video, # Updated to use args.video
"-c:v", "libx264", # Use a standard codec
"-crf", "22", # A reasonable CRF value for quality
"-strict", "-2",
args.outfile
]
subprocess.run(command, shell=platform.system() != "Windows")
main.py:
@app.post("/run_inference")
def run_inference():
"""
Run the inference on the video and audio files in the 'test' folder.
"""
try:
os.system(
""" python Wav2Lip\inference.py --checkpoint_path Wav2Lip\checkpoints\wav2lip.pth -- face "test/video.mp4" --video "test/video.mp4" --audio "test/audio.wav" --pads 0 20 0 0 """
)
return "done"
except Exception as e:
return str(e)
I am giving video and audio file as an input and trying to run wav2lip locally to give a output video. But when inference.py triggers the subprocess call it gives me an error and program halt.