How to remove audio and video streams in a media file using FFmpeg
Many times we are either looking for only the video or the audio component of a media file. This is useful for people who are making video mix or if you can't find a mp3 for a song but have a video file.
How to remove audio stream from a media file using FFmpeg
In order to remove the audio stream, we can use the '-an' flag, which stands for "no audio recording". Suppose you have a media file inputfile.avi and you want to remove the audio, this is how you do it. This option will negate all the other audio related flags because no audio is going to be present in the final output file.
[shredder12]$ffmpeg -i inputfile.avi -an outputfile.avi
How to remove video stream from a media file using FFmpeg
Use '-vn' flag to remove the video from a media file. This flag stands for no video recording. This option will negate all the video options since the final output file has only the audio component. But audio options will still work, say you want to remove the video content and want a 128kbps audio file.
[shredder12]$ffmpeg -i inputfile.avi -vn -ab 128 outputfile.mp3



























2 Comments
Post new comment