Search code examples
asp.net-core.net-coreffmpeg

replace audio using FFMPEG.Core


I have used FFMpegCore which is wrapper library for using ffmpeg in .net Core. It has a simple 'ReplaceAudio' method for changing audio of existing video, but it doesn't work and nothing changes in output video.

FFMpeg.ReplaceAudio(inputPath, inputAudioPath, outputPath);

does it have any trick or requirement ?


Solution

  • using Mute function before using ReplaceAudio will fix the problem.

    FFMpeg.Mute(videoFile, mutedVideo);
    FFMpeg.ReplaceAudio(mutedVideo, audioFile, videoFile, true);