75lb / handbrake-js

Video encoding / transcoding / converting for node.js
Other
550 stars 69 forks source link

Progress event not working #36

Closed ahnteve closed 5 years ago

ahnteve commented 5 years ago

my code:

hbjs.spawn({ input: 'source.mpg', output: target.mp4', preset : 'Universal' })
    .on('progress', progress => {
      console.log(
        'Percent complete: %s, ETA: %s',
        progress.percentComplete,
        progress.eta
      )
    })
    .on('complete', () => {
      console.log('complete');
    });

log:

0|www    | Percent complete: 2.17, ETA:
PM2      | App [www:0] exited with code [1] via signal [SIGINT]
PM2      | pid=9256 msg=process killed

I think the log should be written like this.

0|www    | Percent complete: 2.17, ETA:
0|www    | Percent complete: 5.63, ETA:
0|www    | Percent complete: 8.42, ETA:
0|www    | Percent complete: 13.34, ETA:
more ...

Do you know why it works like this way? Did I write it wrong?

75lb commented 5 years ago

Hi, sorry for the slow reply. I can't reproduce this, is it still an issue? If so, could you post instructions how to reproduce please.

ahnteve commented 5 years ago

I upload a MPG video from a client. The server takes the video path, converts it into MP4 video, and uploads it to the 'upload' folder. The file is created, but the file is corrupt.

75lb commented 5 years ago

Hi, like i said - i can't reproduce the failing case from a description of the issue alone.. Please send a reproduction case (paste some code or a codepen/jsfiddle link that I can actually run and debug).

ahnteve commented 5 years ago

I'm sorry to bother you.

my code: 2 files.videofile.path = C:\Users\USERNAME~1\AppData\Local\Temp\upload_030f5648b41c5f0153f4e30f9765c2bc

log: 1

I think the reason it doesn't work is because it doesn't have an extension. ....

result: 56 Video.mp4 was created but corrupted.