Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot npm install dplayer-thumbnails #1

Open
zijian85 opened this issue May 22, 2018 · 2 comments
Open

Cannot npm install dplayer-thumbnails #1

zijian85 opened this issue May 22, 2018 · 2 comments

Comments

@zijian85
Copy link

Hi,when I install dplayer-thumbnails, it shows the messages as follows:

$ npm install -g dplayer-thumbnails
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/src/nodejs/bin/dplayer-thumbnails -> /usr/local/src/nodejs/lib/node_modules/dplayer-thumbnails/index.js

I have installed the newest Nodejs and my system is Linux LAX 2.6.32-696.16.1.el6.x86_64 #1 SMP Wed Nov 15 16:51:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux.

screen

@mr1985
Copy link

mr1985 commented May 25, 2018

I know I am not answering your question, but I would like to show you an alternative way to generate thumbnails. I was also unable to install dplayer-thumbnails.

You will need FFMPEG & ImageMagick.

STEP 1 : Take screen shoots with FFMPEG

ffmpeg -i YOUR_VIDEO -f image2 -bt 20M -vf fps=100/VIDEO_LENGTH_IN_SEC -aspect 16:9 %03d.jpg

For example, Sintel movie trailer is 52 seconds length.
fmpeg -i sintel_trailer-720p.mp4 -f image2 -bt 20M -vf fps=100/52 -aspect 16:9 %03d.jpg

STEP 2 : Generate the montage file with ImageMagick

montage *jpg -tile x1 -geometry 160x montage.jpg

Results:
montage

Implementation:

<head>
  <title>Dplayer</title>
  <meta charset="UTF-8">
  <!-- Style -->
  <link rel=stylesheet type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/dplayer/1.22.2/DPlayer.min.css"></link>
  <!-- Player -->
  <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/dplayer/1.22.2/DPlayer.min.js"></script>
</head>

<body>
  <div id="dplayer"></div>
  <script>
    const dp = new DPlayer({
      container: document.getElementById('dplayer'),
      video: {
        url: 'sintel_trailer-720p.mp4',
        type: 'auto',
        thumbnails:'montage.jpg'
      },

    });
  </script>
</body>

final result

@Da-wukong
Copy link

Need to install the node - v10 version to success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants