{"id":8990,"date":"2021-12-19T17:38:33","date_gmt":"2021-12-19T16:38:33","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=8990"},"modified":"2021-12-19T17:38:33","modified_gmt":"2021-12-19T16:38:33","slug":"how-to-do-noise-reduction-using-ffmpeg-and-sox-articulating-ideas","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2021\/12\/19\/how-to-do-noise-reduction-using-ffmpeg-and-sox-articulating-ideas\/","title":{"rendered":"How To Do Noise Reduction Using ffmpeg And sox &#8211; Articulating ideas"},"content":{"rendered":"<p><em><a href=\"http:\/\/www.zoharbabin.com\/how-to-do-noise-reduction-using-ffmpeg-and-sox\/\">How To Do Noise Reduction Using ffmpeg And sox &#8211; Articulating ideas<\/a><\/em><\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<header class=\"page-header\">\n<div class=\"entry-meta\"><span class=\"by-author\"> <span class=\"sep\"> by <\/span> <span class=\"author vcard\"><a class=\"url fn n\" title=\"View all posts by Zohar Babin\" href=\"http:\/\/www.zoharbabin.com\/author\/admin\/\" rel=\"author\">Zohar Babin<\/a><\/span><\/span><\/div>\n<\/header>\n<div class=\"entry-content clearfix\">\n<p>Need a quick, easy and free way of cleaning up a video\u2019s audio from background noise ? Follow the steps below to remove background audio from videos.<\/p>\n<p><strong>First get and\u00a0install the tools:<\/strong><\/p>\n<ul>\n<li><a title=\"FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video\" href=\"http:\/\/ffmpeg.org\/\" target=\"_blank\" rel=\"noopener\">FFMPEG<\/a>.<\/li>\n<li><a title=\"SoX, the Swiss Army knife of sound processing programs\" href=\"http:\/\/sox.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">SoX \u2013 Sound eXchange<\/a>.<\/li>\n<\/ul>\n<p><strong>Then clean your noise!<\/strong><\/p>\n<ol>\n<li>Split the audio and video streams into 2 seperate files:<br \/>\nThe VIDEO stream: <em><strong>ffmpeg -i input.mp4 -vcodec copy -an tmpvid.mp4<\/strong><\/em><br \/>\nThe AUDIO stream: <em><strong>ffmpeg -i input.mp4 -acodec pcm_s16le -ar 128k -vn tmpaud.wav\u00a0<\/strong><\/em><\/li>\n<li>Generate a sample of noise from the audio of the file:<br \/>\n<em><strong>ffmpeg -i input.mp4 -acodec pcm_s16le -ar 128k -vn -ss 00:00:00.0 -t 00:00:00.5 noiseaud.wav<br \/>\n<\/strong><\/em><strong>-ss<\/strong>: the time offset from beginning. (h:m:s.ms).<br \/>\n<strong>-t duration<\/strong>: the duration (h:m:s.ms) of audio segment to cut that represents the noise.<br \/>\nChoose a segment of the audio where there\u2019s no speech, only noise (e.g. speaker was silent for a sec).<\/li>\n<li>\u00a0Generate a noise profile in sox:<br \/>\n<em><strong>sox noiseaud.wav -n noiseprof noise.prof<\/strong><\/em><\/li>\n<li>Clean the noise samples from the audio stream:<br \/>\n<em><strong>sox tmpaud.wav tmpaud-clean.wav noisered noise.prof 0.21<br \/>\n<\/strong><\/em>Change\u00a0<em><strong>0.21<\/strong><\/em>\u00a0to adjust the level of sensitivity in the sampling rates (I found 0.2-0.3 often provides best result).<\/li>\n<li>Merge the audio and video streams back together:<br \/>\n<strong>ffmpeg -i tmpvid.mp4 -i tmpaud-clean.wav -map 0:v -map 1:a -c:v copy -c:a aac -b:a 128k out.mp4<\/strong><\/li>\n<\/ol>\n<div>I\u2019m thinking of automating this via a web interface that allows uploading a video file, selection of the noise sample and playing with the noisered levels producing a cleaned version\u2026 think it\u2019s a useful tool?<\/div>\n<div><\/div>\n<div>Thanks for all the contributors in the comments!<\/div>\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">How To Do Noise Reduction Using ffmpeg And sox &#8211; Articulating ideas<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2021\/12\/19\/how-to-do-noise-reduction-using-ffmpeg-and-sox-articulating-ideas\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-8990","post","type-post","status-publish","format-link","hentry","category-senza-categoria","post_format-post-format-link"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2l0","jetpack-related-posts":[{"id":8347,"url":"https:\/\/monodes.com\/predaelli\/2021\/04\/11\/ffmpeg-to-youtube-live\/","url_meta":{"origin":8990,"position":0},"title":"FFMPEG to Youtube Live","author":"Paolo Redaelli","date":"2021-04-11","format":false,"excerpt":"video - FFMPEG to Youtube Live - Stack Overflow After a lot of trial and error the solution below works pretty much perfectly. To make sure it runs 24\/7 wrap it inside a service of some description. This is with an up to date version of FFMPEG to include -stream_loop\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6834,"url":"https:\/\/monodes.com\/predaelli\/2020\/03\/04\/useful-ffmpeg-commands-for-working-with-audio-and-video-files-digital-inspiration\/","url_meta":{"origin":8990,"position":1},"title":"Useful FFmpeg Commands for Working with Audio and Video Files &#8211; Digital Inspiration","author":"Paolo Redaelli","date":"2020-03-04","format":"link","excerpt":"Useful FFmpeg Commands for Working with Audio and Video Files - Digital Inspiration Useful FFmpeg Commands FFmpeg supports all popular audio and video formats. Or you can running the command .\/ffmpeg -formats to get a list of every format that is supported by your FFmpeg installation. If you are just\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7993,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/audio-how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream-stack-overflow\/","url_meta":{"origin":8990,"position":2},"title":"audio &#8211; how to transform live RTMP video to live mp3 Icecast stream &#8211; Stack Overflow","author":"Paolo Redaelli","date":"2021-01-03","format":false,"excerpt":"Source: audio - how to transform live RTMP video to live mp3 Icecast stream - Stack Overflow I have RTMP live stream with video and audio. I can get ogg audio live stream from RTMP and translate it to Icecast2 and get it on my site using JPlayer. Now i\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13797,"url":"https:\/\/monodes.com\/predaelli\/2025\/07\/20\/13797\/","url_meta":{"origin":8990,"position":3},"title":"I visited Terence blog to\u2026","author":"Paolo Redaelli","date":"2025-07-20","format":false,"excerpt":"I visited Terence blog to read about some Easy ways to add watermarks to images and videos in Linux but I found a very nice and clean to take inspiration from! Mostly notes to myself :-) Here is a quick way to add watermarks to photos and videos. All Linux\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/shkspr.mobi\/blog\/wp-content\/litespeed\/avatar\/af6a5dd8373bf52386c67599d3a74158.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4928,"url":"https:\/\/monodes.com\/predaelli\/2018\/11\/17\/green-recorder-a-simple-screen-recorder-for-linux-with-wayland-support-2daygeek-com\/","url_meta":{"origin":8990,"position":4},"title":"Green Recorder &#8211; A Simple Screen Recorder For Linux With Wayland Support | 2daygeek.com","author":"Paolo Redaelli","date":"2018-11-17","format":false,"excerpt":"Green recorder is a free, open source, simple desktop recorder for Linux systems and written using Python, GTK+3 and ffmpeg. It supports audio and video Source: Green Recorder - A Simple Screen Recorder For Linux With Wayland Support | 2daygeek.com","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7079,"url":"https:\/\/monodes.com\/predaelli\/2020\/06\/01\/cura-dimagrante\/","url_meta":{"origin":8990,"position":5},"title":"Cura dimagrante","author":"Paolo Redaelli","date":"2020-06-01","format":false,"excerpt":"ffmpeg -i Palme\\ 2020.mp4 -vcodec libx265 -crf 28 -vf scale=1280:-1 Domenica-delle-palme.mp4 Per far dimagrire un video da 402Mb a 9,9Mb. Ok, ok, chi si loda s'imbroda, tanto pi\u00f9 che fa tutto ffmpeg, mica io! Ma vediamo il perch\u00e9 dopo aver visto il percome: il video in origine era codificato in\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=8990"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/8990\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=8990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=8990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=8990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}