npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

avconv-utils

v0.1.6

Published

utility functions to perform operations on videos using avconv

Downloads

9

Readme

dependency status published version still maintained?

NPM NPM

motivation

Can be used to fetch frames from a video and create mosaics out of them for better storage and distribution.

Possible usage scenarios:

  • show preview in video slider
  • auxiliary imagery for non linear editing of videos

requirements

  • Requires graphicsmagick to be installed:

    sudo apt-get install graphicsmagick

  • Requires avconv to be installed with x264 support (if reading h.264 videos) Read how to do it here.

examples

The following examples are available in samples

And the video used it them is this one:

source video

do mosaic magic

Source code:

var au = require('avconv-utils');
au.doMosaicMagic(
  {
    video:    'jTE4TOJANeatDmQi341m.mp4',
    scale:    0.25,
    fps:      1,
    strategy: 'square',
    mosaic:   'mosaics/jTE4TOJANeatDmQi341m.jpg'
  },
  function(err, res) {
    if (err) { throw (err); }
    console.log(res);
  }
);

Callback result is:

{
  mosaicDimensions: [870, 984],
  frameDimensions:  [145, 82],
  strategy:         'square',
  outFile:          'mosaics/jTE4TOJANeatDmQi341m.jpg',
  grid:             [6, 12],
  n:                68,
  videoDuration:    66.41,
  videoDimensions:  [580, 326]
}

and the following mosaic image:

resulting mosaic

Note: The square strategy displayed above is the most appropriate for humans to inspect the result. If you're scripting a preview slider based on CSS properties horizontal or vertical strategies are better suited for such purpose. They compose the mosaic in a single row/column respectively.

get metadata

Source code:

var au = require('../lib/avconv-utils');
au.getMetadata(
  'jTE4TOJANeatDmQi341m.mp4',
  function(err, res) {
    if (err) { throw (err); }
    console.log(res);
  }
);

Callback result is:

{
  duration:     '00:01:06.41',
  durationSecs: 66.41,
  vCodec:       'h264 (Constrained Baseline)',
  vDetails:     'Video: h264 (Constrained Baseline), yuv420p, 580x326 [PAR 1:1 DAR 290:163], 694 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc',
  dimensions:   [580, 326],
  aCodec:       'aac',
  aDetails:     'Audio: aac, 48000 Hz, stereo, s16, 127 kb/s'
}

usage

Check API.

Usage examples in bin/* command line utilities and tests directory.

changelog

Check LOG.