volumenetwork / video-thumbnail-generator Goto Github PK
View Code? Open in Web Editor NEWnode js module to create thumbnails from a video
node js module to create thumbnails from a video
when i install this module and try to execute code then it's says that "Unhandled Rejection Error: Cannot find ffprobe"
Unhandled rejection Error: Cannot find ffprobe
for example I need to find a package which is taking thumbnails from "mp4, ogg, webm" files, are we able to do it for these formats too ?
I am unable to generate Gif and I am getting following error:
Unhandled rejection Error: ffmpeg exited with code 1: av_interleaved_write_frame(): Input/output error
frame= 1 fps=0.6 q=-0.0 Lsize=N/A time=00:00:00.10 bitrate=N/A speed=0.0646x
video:1kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
at ChildProcess.<anonymous> (/Applications/MAMP/htdocs/video-thumbnail-generator/thumb/node_modules/fluent-ffmpeg/lib/processor.js:177:22)
at ChildProcess.emit (events.js:196:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
FYI: tg.generate() is working fine.
Can this be used to generate sprites for previews such as: https://github.com/flavioribeiro/video-thumbnail-generator ?
Thanks!
Hi !
I see a lot of people struggling with missing FFmpeg / FFprobe installations (#5, #6, #11, #13), with the solution to install those on the related environment manually. This works but can get tedious when working with CI/CD & multiple environments / OSs, & also requires an extra manual installation step.
Having faced the problem myself, I thought I might share the following packages, which are platform independent installers for FFmpeg & FFprobe:
All you need to do is add those as dependencies:
npm i @ffmpeg-installer/ffmpeg @ffprobe-installer/ffprobe
And following fluent-ffmpeg's documentation, you can then set FFmpeg & FFprobe paths as follows:
const ffmpeg = require('fluent-ffmpeg');
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffprobePath = require('@ffprobe-installer/ffprobe').path;
ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);
@irvingswiftj I think those could be directly used in this project & added as dependencies (like in get-video-duration
for example), in order for its installation to be easier, what do you think ? At least, this might be worth mentioning in the project's documentation.
Anyway, thanks a lot for your work ! Cheers !
Hi there,
Does this library also support generating thumbnails for .mov files?
I did make sure that ffmpeg is installed (i'm on windows 10).
Just installed the package (v 2.1.2) and when trying to use it, it gives me the following error:
./node_modules/video-thumbnail-generator/node_modules/fluent-ffmpeg/index.js
Module not found: Can't resolve './lib-cov/fluent-ffmpeg' in 'C:\Electron\vid-gallery\node_modules\video-thumbnail-generator\node_modules\fluent-ffmpeg
```'
I tried installing `fluent-ffmpeg` in my project's `node_modules` directory as well, but to no avail.
@irvingswiftj : First of all, I wanted to congratulate you on the module, even if you still could not try it for different problems.
In the readme.md file, it is written that the module name is:
import ThumbnailGenerator from 'volume-thumbnail-generator';
In reality it should be:
import ThumbnailGenerator from 'video-thumbnail-generator';
We could update the version of the dependencies, in particular of:
-del
-fluent-ffmpeg
P.ล .
Tells me:
unable to resolve module 'path' from '... \ node_modules \ del \ index.js': Module does not exist in the module map.
The module is there but I do not understand how to solve everything, some advice?
It seems the (err, result) parameters are switched in the documentation compared to what actually happens in the code, the correct order is (result, err).
Also could you clarify what does "generateOneByPercent" do?
Thanks.
There are thumbnail typos across src/index.js
thumbanilPath
thumbailPath
thumbnailPath
And function name:
generateOneByPerentCb
Here's the FIX for cannot find ffprobe or ffmpeg issue:
const tg = new ThumbnailGenerator({ sourcePath: "sourcePath/", thumbnailPath: 'destinationPath/' }); tg.generateOneByPercentCb(90, (err, result) => { if (err) throw err; console.log(result); // 'test-thumbnail-320x240-0001.png' });
ffmpeg(sourcePath) .screenshots({ timestamps: [0.0], filename: 'thumbnail.png', folder: destinationPath }) .on('end', err => { if (err) throw err; console.log('done'); });
I'm using your tool in my project and github has flagged up to me some security issues with the version of lodash that is a dependency of this tool. I have attached the security report as well as the version of lodash that this tool is using.
Please update the version of lodash in this project to the more recent version.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.