Code Monkey home page Code Monkey logo

video-thumbnail-generator's People

Contributors

irvingswiftj avatar james-richards-privitar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

video-thumbnail-generator's Issues

is this only for mp4 files ?

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 ?

generateGif issue

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.

Avoid manual installation of FFmpeg & FFprobe

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 !

Is .mov supported?

Hi there,

Does this library also support generating thumbnails for .mov files?

Can't resolve './lib-cov/fluent-ffmpeg

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.

Readme mistake and dependencies need updating

@irvingswiftj : First of all, I wanted to congratulate you on the module, even if you still could not try it for different problems.

  1. 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';

  2. 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?

Docs: (err, result) are switched

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.

Cannot find ffprobe OR ffmpeg - node react vscode

Here's the FIX for cannot find ffprobe or ffmpeg issue:

  1. Google ffmpeg and install it on your computer.
  2. Extract it and move the extracted folder to the C drive or programs locations
  3. On windows add it to environment path if you want
  4. Go back to vs code and npm install ffmpeg ffprobe
  5. Then add this line (for windows) - the path should be path where the program is:
    ffmpeg.setFfmpegPath('C:/ffmpeg/bin/ffmpeg.exe');
    ffmpeg.setFfprobePath('C:/ffmpeg/bin/ffprobe.exe');
  6. If you're using video thumbnail generator:
    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' });
    6b) If you're using ffmpeg:
    ffmpeg(sourcePath) .screenshots({ timestamps: [0.0], filename: 'thumbnail.png', folder: destinationPath }) .on('end', err => { if (err) throw err; console.log('done'); });

Security issues with the version of lodash being used

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
lodash-security
lodash-security-2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.