{"id":580,"date":"2024-08-19T19:55:43","date_gmt":"2024-08-19T23:55:43","guid":{"rendered":"https:\/\/waterloobae.com\/?p=580"},"modified":"2025-08-20T14:26:57","modified_gmt":"2025-08-20T18:26:57","slug":"blurring-faces-and-stabilizing","status":"publish","type":"post","link":"https:\/\/waterloobae.com\/blog\/2024\/08\/19\/blurring-faces-and-stabilizing\/","title":{"rendered":"Blurring faces and Stabilizing your videos"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I am using <a href=\"https:\/\/github.com\/ORB-HD\/deface\">Deface<\/a> 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. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hardware Acceleration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">One of them was using Hardware acceleration. For silicon chip ( M1, M2, M3&#8230;) Macs, you can install ONNX Runtime execution provider as<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">Pip install onnxruntime<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For Windows, you can install CUDA from Nvidia. Instructions can be found from README.md file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For stabilizing, <a href=\"https:\/\/www.ffmpeg.org\/\">FFmpeg<\/a> 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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">ffmpeg -hwaccel videotoolbox -i \"$FINAL_OUTPUT\" ...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Encoding with this transformed file can be exceled with hwaccel option. If you need to use the script for various systems. &#8220;-hwaccel auto&#8221; might work for them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">ffmpeg -hwaccel auto -i \"$FINAL_OUTPUT\" ...<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Deface scale option<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I haven&#8217;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.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">deface --scale 1280x720 myvideo.mp4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change resolution according to your video and try to keep ratio.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-580","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/580","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/comments?post=580"}],"version-history":[{"count":7,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions"}],"predecessor-version":[{"id":590,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/posts\/580\/revisions\/590"}],"wp:attachment":[{"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/media?parent=580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/categories?post=580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/waterloobae.com\/blog\/wp-json\/wp\/v2\/tags?post=580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}