To remove the video and extract only the audio from a video file using ffmpeg, you can use the following command:

ffmpeg -i input_video.mp4 -vn -acodec copy output_audio.aac

Let’s break down the above command:

  • -i input_video.mp4 specifies the input video file.
  • -vn option tells ffmpeg to ignore the video stream and only extract the audio stream.
  • -acodec copy option tells ffmpeg to copy the audio codec from the input file to the output file, without re-encoding the audio stream.
  • output_audio.aac is the name and format of the output audio file.

After executing this command, ffmpeg will extract the audio from the input video file and save it as a new audio file with the specified name and format.

Thanks for reading

Leave a Reply

Your email address will not be published. Required fields are marked *