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

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!