ffmpeg-progressbar-cli icon indicating copy to clipboard operation
ffmpeg-progressbar-cli copied to clipboard

moment.duration(...).format is not a function

Open asm0dey opened this issue 6 years ago • 4 comments

 $ ffmpeg-bar -i Untitled\ Project.mp4 Untitled.mkv                                                                                                                                                                                [10:22:26]
/usr/lib/node_modules/ffmpeg-progressbar-cli/lib/progress-bar.js:47
    return moment.duration(seconds, 'seconds').format(etaFormat, { trim: false })
                                               ^

TypeError: moment.duration(...).format is not a function
    at convertSecondsToTimecode (/usr/lib/node_modules/ffmpeg-progressbar-cli/lib/progress-bar.js:47:48)
    at Object.startBar [as start] (/usr/lib/node_modules/ffmpeg-progressbar-cli/lib/progress-bar.js:97:22)
    at Socket.onData (/usr/lib/node_modules/ffmpeg-progressbar-cli/lib/main.js:122:17)
    at Socket.emit (events.js:193:13)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:276:11)
    at Socket.Readable.push (_stream_readable.js:231:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:154:17)

asm0dey avatar Jun 05 '19 07:06 asm0dey

I have the same issue

But in my case, I'm using two computers...where one of them runs correctly and the other one spits out this error

ghost avatar Jun 06 '19 00:06 ghost

Update

I actually managed to fix the issue, bellow are all the steps I used to troubleshoot/fix the issue

  • Install module locally:
npm install ffmpeg-bar-cli
npm install
  • run the install command exactly as descibed in the README-file. I had previously changed the order of the commands...which really should not make a difference, but apparently it does.
npm install --global ffmpeg-progressbar-cli

After this I got this reponse

+ [email protected]
updated 2 packages in 1.531s

If you instead get a message about saying that "no changes were nessesary"...it will not be resolved by these command.

ghost avatar Jun 06 '19 00:06 ghost

@mnervik there is no such instructions in readme file. There is only one command for installation

asm0dey avatar Jun 06 '19 06:06 asm0dey

ok...just saying what I did initially, and what I did to troubleshoot and fix the issue.

ghost avatar Jun 16 '19 11:06 ghost