> [email protected] start /home/daffodil/repos/node-gify-master
> node example.js
/home/daffodil/repos/node-gify-master/example.js:24
if (err) throw err;
^
Error: Command failed: /bin/sh -c ffmpeg -i out.mp4 -filter:v scale=-1:300 -r 10 /tmp/IP5OXJZELd/%04d.png
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --disable-yasm
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 31.100 / 6. 31.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42mp41
creation_time : 2005-02-25 02:35:57
Duration: 00:01:10.00, start: 0.000000, bitrate: 106 kb/s
Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 19 kb/s (default)
Metadata:
creation_time : 2005-02-25 02:35:57
handler_name : Apple Sound Media Handler
Stream #0:1(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D), yuv420p, 192x242 [SAR 1:1 DAR 96:121], 76 kb/s, 15 fps, 15 tbr, 600 tbn, 1k tbc (default)
Metadata:
creation_time : 2005-02-25 02:35:57
handler_name : Apple Video Media Handler
Stream #0:2(eng): Data: none (rtp / 0x20707472), 4 kb/s (default)
Metadata:
creation_time : 2005-02-25 02:35:57
handler_name : hint media handler
Stream #0:3(eng): Data: none (rtp / 0x20707472), 3 kb/s (default)
Metadata:
creation_time : 2005-02-25 02:35:57
handler_name : hint media handler
Output #0, image2, to '/tmp/IP5OXJZELd/%04d.png':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42mp41
Stream #0:0(eng): Video: png, none, q=2-31, 128 kb/s (default)
Metadata:
creation_time : 2005-02-25 02:35:57
handler_name : Apple Video Media Handler
Stream mapping:
Stream #0:1 -> #0:0 (mpeg4 (native) -> ? (?))
Encoder (codec png) not found for output stream #0:0
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:100:13)
at ChildProcess.emit (events.js:185:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:90:13)
at Socket.emit (events.js:182:7)
at Pipe._onclose (net.js:471:12)
PS: I had a couple of problems installing FFmpeg on my Ubuntu 14.04.
After read this log a couple of times, I managed to produce a sample GIF from my mp4 file, by changing the command, which example.js
tries to run:
But it's still using command line, I need to do this by code.
So I dived into the code and found that this wrong url is coming from this line in index.js
...
// tmpfile(s)
var id = uid(10);
var dir = path.resolve('/tmp/' + id);
var tmp = path.join(dir, '/%04d.png');
...