Wav input to m4a Invalid data found when processing input

For the developers that use FFmpeg in their software.
Post Reply
jadriennneee
Posts: 1
Joined: Sun Apr 07, 2019 5:43 am

Wav input to m4a Invalid data found when processing input

Post by jadriennneee » Sun Apr 07, 2019 5:48 am

I am having an error on converting wav files to m4a. The following error always show up

"An error occurred: ffmpeg exited with code 1: ./tmp/2-7U1f3AYbq.wav: Invalid data found when processing input"

Here is my code:

Code: Select all

ffmpeg({ source: inputPath })
      .audioChannels(2)
      .audioCodec('aac')
      .on('error', err => {
        console.log('An error occurred: ' + err.message);
      })
      .on('progress', progress => {
        console.log('Processing: ' + progress.targetSize + ' KB converted');
      })
      .on('end', () => {
        deleteTmp(inputPath);
      })
      .save(outputPath);
    } catch (err) {
      console.log(err);
    }

Post Reply