I am using Deface to blue faces automatically in my YouTube. It used take me over 10 hours to process 18 minutes long 4K 30FPS video for me. So, I read README.md carefully. The blurring time went down to 1 hour for now. It got faster 10 times.
Hardware Acceleration
One of them was using Hardware acceleration. For silicon chip ( M1, M2, M3…) Macs, you can install ONNX Runtime execution provider as
Pip install onnxruntime
For Windows, you can install CUDA from Nvidia. Instructions can be found from README.md file.
For stabilizing, FFmpeg is used and you can add hardware acceleration option for each GPU type. For Macs it will look like as below. However, It did not work for me. This step was quicker without hwaccel option for me.
ffmpeg -hwaccel videotoolbox -i "$FINAL_OUTPUT" ...
Encoding with this transformed file can be exceled with hwaccel option. If you need to use the script for various systems. “-hwaccel auto” might work for them.
ffmpeg -hwaccel auto -i "$FINAL_OUTPUT" ...
Deface scale option
I haven’t paid much attention to this option since I do not read instructions carefully until I had suffered from my ignorance. Then, I realized that this is very key option to speed up video processes. You can just do.
deface --scale 1280x720 myvideo.mp4
Change resolution according to your video and try to keep ratio.