Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 873 Bytes

remove-audio-from-video-with-ffmpeg.md

File metadata and controls

21 lines (14 loc) · 873 Bytes

Remove audio from video with ffmpeg -an option

If you have a video that does not need sound, like a background video on a web page, you can remove the sound with ffmpeg and the -an flag. This will help reduce file size.

ffmpeg -i [input_file] -vcodec copy -an [output_file]

From the documentation:

The presence of -an disables audio stream selection

See on Stackoverflow and official documentation.

You can also output audio and video separately:

ffmpeg -i input.mp4 -map 0:0 -c:v copy only_video.mp4
ffmpeg -i input.mp4 -map 0:1 -c:a copy only_audio.mp4

This snippet from Stack overflow