{"id":76,"date":"2026-07-17T10:50:27","date_gmt":"2026-07-17T10:50:27","guid":{"rendered":"https:\/\/demensdeum.com\/blog\/2026\/07\/17\/stabilize-video-ffmpeg\/"},"modified":"2026-07-17T10:50:27","modified_gmt":"2026-07-17T10:50:27","slug":"stabilize-video-ffmpeg","status":"publish","type":"post","link":"https:\/\/demensdeum.com\/blog\/es\/2026\/07\/17\/stabilize-video-ffmpeg\/","title":{"rendered":"Video stabilization using ffmpeg"},"content":{"rendered":"<p>If you want to stabilize videos and remove camera shake, the `ffmpeg` tool offers a powerful solution. Thanks to the built-in filters `vidstabdetect` and `vidstabtransform`, you can achieve professional results without using complex video editors.<\/p>\n<h2>Preparing for work<\/h2>\n<p>Before you start, make sure your `ffmpeg` supports the `vidstab` library. On Linux you can check this with the command:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"bash\"><code>bash  \nffmpeg -filters | grep vidstab  \n<\/code><\/pre>\n<\/div>\n<p>If the library is not installed, you can add it:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"bash\"><code>sudo apt install ffmpeg libvidstab-dev  \n<\/code><\/pre>\n<\/div>\n<p>Installation for macOS via brew:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"bash\"><code>brew install libvidstab\nbrew install ffmpeg\n<\/code><\/pre>\n<\/div>\n<p>Now let&#8217;s move on to the process.<\/p>\n<p>Step 1: Motion Analysis<\/p>\n<p>First you need to analyze the motion of the video and create a file with stabilization parameters.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"bash\"><code>ffmpeg -i input.mp4 -vf vidstabdetect=shakiness=10:accuracy=15 transfile=transforms.trf -f null -  \n<\/code><\/pre>\n<\/div>\n<p>Parameters:<\/p>\n<p>shakiness: Video shake level (default 5, can be increased to 10 for more complex cases).<br \/>\naccuracy: Analysis accuracy (default 15).<br \/>\ntransfile: File name to save the motion parameters.<\/p>\n<p>Step 2: Apply Stabilization<\/p>\n<p>Now you can apply stabilization using the transformation file:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"bash\"><code>ffmpeg -i input.mp4 -vf vidstabtransform=input=transforms.trf:zoom=5 output.mp4\n<\/code><\/pre>\n<\/div>\n<p>Parameters:<\/p>\n<p>input: Points to the file with transformation parameters (created in the first step).<br \/>\nzoom: Zoom factor to remove black edges (e.g. 5 &#8211; auto zoom until artifacts are removed).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to stabilize videos and remove camera shake, the `ffmpeg` tool offers a powerful solution. Thanks to the built-in filters `vidstabdetect` and `vidstabtransform`, you can achieve professional results without using complex video editors. Preparing for work Before you start, make sure your `ffmpeg` supports the `vidstab` library. On Linux you can check this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-notes"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"es","enabled_languages":["en","ru","zh","de","ja","fr","es","pt","hi"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"ru":{"title":true,"content":true,"excerpt":false},"zh":{"title":true,"content":true,"excerpt":false},"de":{"title":true,"content":true,"excerpt":false},"ja":{"title":true,"content":true,"excerpt":false},"fr":{"title":true,"content":true,"excerpt":false},"es":{"title":false,"content":false,"excerpt":false},"pt":{"title":true,"content":true,"excerpt":false},"hi":{"title":true,"content":true,"excerpt":false}}},"_links":{"self":[{"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":0,"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demensdeum.com\/blog\/es\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}