c# extract mp3 file from mp4 file

Viewed 10205

is there any easy way of extracting a mp3 file from a mp4 file?

I've already tried to change the file extension, but that won't let me to edit the mp3 description.

thank you!

2 Answers

Use Xabe.FFmpeg. It's free (non-commercial use), has public repository on GitHub, cross-platform (written in .NET Standard).

Extracting mp3 from mp4 just by 3 lines:

    string output = Path.ChangeExtension(Path.GetTempFileName(), FileExtensions.Mp3);
    IConversionResult result = await Conversion.ExtractAudio(Resources.Mp4WithAudio, output)
                                               .Start();

It requires FFmpeg executables like in other answer but you can download it by

    FFmpeg.GetLatestVersion();

Full documentation available here - Xabe.FFmpeg Documentation

Related