{"id":531,"date":"2013-07-14T14:08:53","date_gmt":"2013-07-14T13:08:53","guid":{"rendered":"https:\/\/hoover.gplrank.de\/?p=531"},"modified":"2013-07-14T14:14:18","modified_gmt":"2013-07-14T13:14:18","slug":"snipping-and-adding-fade-in-out-effects-using-ffmpeg","status":"publish","type":"post","link":"https:\/\/hoover.gplrank.de\/?p=531","title":{"rendered":"Snipping and adding fade in \/ out effects using ffmpeg"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/ffmpeg.mplayerhq.hu\/ffmpeg-logo.png\" width=\"396\" height=\"100\" \/><\/p>\n<p>While you might think ffmpeg is well documented on Linux given its relative maturity, I found the docs provided very confusing and even misleading as some filters (like &#8220;afade&#8221;) referenced in many examples weren&#8217;t even availble on Ubuntu 12.04 LTS. (check your own version using the &#8220;-filters&#8221; ffmpeg argument: After much searching and googling, I arrived at the solution below and I&#8217;m documenting it here for my own use and posterity \ud83d\ude09<\/p>\n<p>Get the latest static ffmpeg build to make sure you have the &#8220;afade&#8221; filter available for Linux:<\/p>\n<p><a style=\"line-height: 1.714285714; font-size: 1rem;\" href=\"http:\/\/ffmpeg.gusari.org\/static\/\">http:\/\/ffmpeg.gusari.org\/static\/<\/a><\/p>\n<p><span style=\"line-height: 1.714285714; font-size: 1rem;\">Extract ffmpeg to somewhere in your path (I use<em> $HOME\/bin<\/em>).\u00a0<\/span><\/p>\n<p>Extract 70 seconds of audio, starting at 60 seconds into the file:<\/p>\n<pre>ffmpeg -i test.mp3 \u00a0-ss 60 -t 70 test01.mp3<\/pre>\n<p>Add the fade-in effect (4 seconds):<\/p>\n<pre>ffmpeg -i test01.mp3 -af \"afade=t=in:ss=0:d=4\" test02.mp3<\/pre>\n<p>Add the fade-out effect (5 seconds, starting at 65 seconds) to the new file:<\/p>\n<pre>ffmpeg -i test02.mp3 -af \"afade=t=out:st=65:d=5\" test03.mp3<\/pre>\n<p>I guess this could be done in a better way, combining the snipping and the filtering in one go, but I couldn&#8217;t figure out the correct filter \/ snipping syntax. If you do, please comment.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While you might think ffmpeg is well documented on Linux given its relative maturity, I found the docs provided very confusing and even misleading as some filters (like &#8220;afade&#8221;) referenced in many examples weren&#8217;t even availble on Ubuntu 12.04 LTS. (check your own version using the &#8220;-filters&#8221; ffmpeg argument: After much searching and googling, I [&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,6],"tags":[],"class_list":["post-531","post","type-post","status-publish","format-standard","hentry","category-it","category-music"],"_links":{"self":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=531"}],"version-history":[{"count":6,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/531\/revisions"}],"predecessor-version":[{"id":536,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/531\/revisions\/536"}],"wp:attachment":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}