Node-fluent-ffmpeg: Conversion results in "Invalid data found when processing input"?

Created on 26 Apr 2016  路  1Comment  路  Source: fluent-ffmpeg/node-fluent-ffmpeg

I am trying to convert a Quicktime movie to MPEG4 with the following code:

var command = new ffmpegCommand(inputFile);
    command
    .on('start', function(command) {
        console.log('Start: ', command);
    })
    .withAudioCodec('copy')
    .withVideoCodec('copy')
    .output(outputFile)
    .on('error', function(err) {
        console.log('An error occurred: ' + err.message, err);
    })
    .on('end', function() {
        console.log('Processing finished !');
        callback();
    });
    command.run();

When I run it I get the following output:

Start:  ffmpeg -i /data/app-3213/users/123241123/123241123-cf9e19c940d461cd504c428f74a5aab8cf80fa25.MOV -y -acodec copy -vcodec copy /Library/WebServer/Documents/cache/app-3213/media/video/123241123-cf9e19c940d461cd504c428f74a5aab8cf80fa25.mp4
An error occurred: ffmpeg exited with code 1: /data/app-3213/users/123241123/123241123-cf9e19c940d461cd504c428f74a5aab8cf80fa25.MOV: Invalid data found when processing input
 [Error: ffmpeg exited with code 1: /data/app-3213/users/123241123/123241123-cf9e19c940d461cd504c428f74a5aab8cf80fa25.MOV: Invalid data found when processing input
]

At the same time, when I copy and paste the ffmpeg command, as displayed above, straight from the command line it succeeds. Do you have any suggestions as to what I could be checking?

Most helpful comment

Further analysis showed it was a bug on my side (as I had assumed). Basically a file move hadn't completed prior to the conversion process, so I was trying to convert a file that did not yet exist a the path.

For anyone else, I got a bit more clarification once I updated the on('error') to:

.on('error', function(err, stdout, stderr) {
                console.log('An error occurred: ' + err.message, err, stderr);
            })

>All comments

Further analysis showed it was a bug on my side (as I had assumed). Basically a file move hadn't completed prior to the conversion process, so I was trying to convert a file that did not yet exist a the path.

For anyone else, I got a bit more clarification once I updated the on('error') to:

.on('error', function(err, stdout, stderr) {
                console.log('An error occurred: ' + err.message, err, stderr);
            })
Was this page helpful?
0 / 5 - 0 ratings

Related issues

LauraWebdev picture LauraWebdev  路  3Comments

Laurian picture Laurian  路  4Comments

judemorrissey picture judemorrissey  路  5Comments

mStirner picture mStirner  路  4Comments

joergbirkhold picture joergbirkhold  路  5Comments