damianociarla / node-ffmpeg

ffmpeg module for nodejs
MIT License
600 stars 140 forks source link

setVideoCodec method and setAudioCodec not accept 'copy' #75

Open MazueraAlvaro opened 4 years ago

MazueraAlvaro commented 4 years ago

I'm doing a copy of a webm file that hasn't the duration data, but when i set the video or audio codec an error occurs:

The code:

const proccess = new ffmpeg(input + ".webm")
    .then((video) => {
        video.setVideoCodec("copy");
        video.setAudioCodec("copy");
        video.save(output + ".webm", (err, files) => {
            if (err) console.log(err);
        });
    })
    .catch((er) => console.log(er));

Error:

{
  code: 113,
  msg: 'The codec "$s" is not supported by the version of ffmpeg copy'
}