Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# extract mp3 file from mp4 file

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!

like image 711
Robert JR Avatar asked Dec 05 '22 14:12

Robert JR


1 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

like image 66
viewbevy Avatar answered Dec 14 '22 20:12

viewbevy