Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

wav2lip: Permission denied #2

Open
zachysaur opened this issue Oct 19, 2024 · 6 comments
Open

wav2lip: Permission denied #2

zachysaur opened this issue Oct 19, 2024 · 6 comments

Comments

@zachysaur
Copy link

even that folder excist it say that running main code

@zachysaur
Copy link
Author

(venv) F:\wav2lip 256x256\wav2lip-onnx-256-main>python -W ignore inference_onnxModel.py --checkpoint_path "checkpoints\wav2lip_256.onnx" --face "F:\wav2lip 256x256\wav2lip-onnx-256-main\face\0.mp4" --audio "F:\wav2lip 256x256\wav2lip-onnx-256-main\audio\1.wav" --outfile "C:\Wav2LipOutputs\new_output.avi" --pads 0 10 0 0 --fps 29.97
Reading video frames...
Number of frames available for inference: 365
Length of mel chunks: 34
0%| | 0/34 [00:00<?, ?it/s]find model: ./insightface_func/models\antelope\scrfd_2.5g_bnkps.onnx detection
set det-size: (320, 320)
100%|██████████████████████████████████████████████████████████████████████████████████| 34/34 [00:00<00:00, 64.96it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 34/34 [00:35<00:00, 1.03s/it]
ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
F:\wav2lip: Permission denied

(venv) F:\wav2lip 256x256\wav2lip-onnx-256-main>

@instant-high
Copy link
Owner

Cannot reproduce.
Copy ffmpeg.exe to the wav2lip root and try again.
Avoid spaces in path.
Try output same drive as input.

@instant-high
Copy link
Owner

Is your output result written to disk?
Permission denied I think it fails deleting the temp file

@zachysaur
Copy link
Author

Yes it want result to be in F: wav2lip

@zachysaur
Copy link
Author

i fixed it . i changed code with your wav2lip hq
out.release()

if args.final_audio:
	if args.hq_output:	
		command = 'ffmpeg.exe -y -i ' + '"' + args.final_audio + '"' + ' -r ' + str(fps) + ' -f image2 -i ' + '"' + './hq_temp/' + '%07d.png' + '"' + ' -shortest -vcodec libx264 -pix_fmt yuv420p -preset slow -acodec libmp3lame -ac 2 -ar 44100 -ab 128000 -strict -2 -q:v 1 ' + '"' + args.outfile + '"'						
	else:
		command = 'ffmpeg.exe -y -i ' + '"' + args.final_audio + '"' + ' -i ' + 'temp/temp.mp4' + ' -shortest -vcodec copy -acodec libmp3lame -ac 2 -ar 44100 -ab 128000 -strict -2 -q:v 1 ' + '"' + args.outfile + '"'
	subprocess.call(command, shell=platform.system() != 'Windows')
	
	if os.path.exists('temp/temp.mp4'):
		os.remove('temp/temp.mp4')
	if  os.path.exists('hq_temp'):
		shutil.rmtree('hq_temp')		
else:
	if args.hq_output:
	  command = 'ffmpeg.exe -y -i ' + '"' + args.audio + '"' + ' -r ' + str(fps) + ' -f image2 -i ' + '"' + './hq_temp/' + '%07d.png' + '"' + ' -shortest -vcodec libx264 -pix_fmt yuv420p -preset slow -acodec libmp3lame -ac 2 -ar 44100 -ab 128000 -strict -2 -q:v 1 ' + '"' + args.outfile + '"'						
	else:						
		command = 'ffmpeg.exe -y -i ' + '"' + args.audio + '"' + ' -i ' + 'temp/temp.mp4' + ' -shortest -vcodec copy -acodec libmp3lame -ac 2 -ar 44100 -ab 128000 -strict -2 -q:v 1 ' + '"' + args.outfile + '"'

	subprocess.call(command, shell=platform.system() != 'Windows')
	
	if os.path.exists('temp/temp.mp4'):
		os.remove('temp/temp.mp4')
	if  os.path.exists('hq_temp'):
		shutil.rmtree('hq_temp')	

@instant-high
Copy link
Owner

Ok. Fine.
Sometimes I make things too simple, no error checking 😎

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants