Remove Audio From Video

By  on  

Sometimes I want to display live motion without the audio, since the audio is either bad quality or it's just extra load, which is especially important on mobile.  You could probably argue converting the video to GIF is more appropriate, but GIFs can be larger and more taxing on the device.  You also cannot pause or control animated GIFs.

The better solution may be to remove the audio from a video:

./ffmpeg -i MusicVideo.webm -vcodec copy -an MusicVideoNoAudio.webm

The -an option removes the the audio from the input file, producing a video without any audio.  The sample file below went from 5.4MB to 4.1MB and now you don't hear the annoying wind in the background.

Recent Features

  • By
    Being a Dev Dad

    I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...

  • By
    6 Things You Didn’t Know About Firefox OS

    Firefox OS is all over the tech news and for good reason:  Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript.  Firefox OS has been rapidly improving...

Incredible Demos

Discussion

  1. If you wanted to you can extract the audio from the video. If you needed the audio for something else.

    ffmpeg -i sample.avi -vn -acodec 'copy' sample-audio.aac
    

    Thanks for the tutorial!

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!