Regarding converting Webm to Mp4 using ffmpeg and getting problem with not receiving audio from the converted video file

Viewed 15

I'm using react-ffmpeg npm package for converting the webm video format to mp4 format. Like here, this is the function which is used to convert the format.

const convertFunc = async(fileurl) => {
console.log("run");
const file = fileurl
console.log("before", file);
await FFMPEG.process(
  file,
  "-f mp4 -c:v libx264 -an -profile:v baseline -level 3.0 -movflags +faststart -hide_banner",
  function (e) {
    console.log(e);
    
    const video = e.result;
    const reader = new FileReader();
      reader.readAsDataURL(video);
      reader.onload = function (e) {

        
        console.log("Process time: ",reader.result);
      };
    console.log(video);
  }
);

}

-f mp4 -c:v libx264 -an -profile:v baseline -level 3.0 -movflags +faststart -hide_banner

this line is used for convert the format. But when I received the converted file. It is muted or there is no audio in it. In the ffmpeg command "-an" is used to remove audio from output converted video. But when I remove it from the above command then also audio is not there.

any solution? Thanks for you answers in advance.

0 Answers
Related