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

vdx

v0.0.11

Published

An intuitive CLI for processing video, powered by FFmpeg

Downloads

31

Readme

vdx npm Version build

An intuitive CLI for processing video, powered by FFmpeg

  • Crop, trim, resize, reverse, rotate, remove audio, change the speed, change the frame rate, change the volume, convert to a different file format
  • Run multiple operations on multiple video files concurrently

Quick start

Requires FFmpeg and Node.js.

$ npm install --global vdx

A variety of common video processing operations are supported:

$ vdx '*.mov' --crop 360,640    # Crop to width 360, height 640
$ vdx '*.mov' --format gif      # Convert to GIF
$ vdx '*.mov' --fps 12          # Change the frame rate to 12
$ vdx '*.mov' --no-audio        # Remove audio
$ vdx '*.mov' --resize 360,-1   # Resize to width 360, maintaining the aspect ratio
$ vdx '*.mov' --reverse         # Reverse
$ vdx '*.mov' --rotate 90       # Rotate 90 degrees clockwise
$ vdx '*.mov' --speed 2         # Double the speed
$ vdx '*.mov' --trim 0:05,0:10  # Trim from 0:05 to 0:10
$ vdx '*.mov' --volume 0.5      # Halve the volume

We can also run multiple operations all at once:

$ vdx '*.mov' --format gif --fps 12 --resize 360,640 --speed 2 --trim 0:05,0:10

By default, the processed files will be written to a directory called ./build. To change this, use the --output option:

$ vdx '*.mov' --format gif --output './gifs'

By default, up to 3 video files will be processed concurrently. To change this, use the --parallel option:

$ vdx '*.mov' --format gif --output './gifs' --parallel 5

Usage

Usage: vdx <files> [options]

<files>

One or more globs of video files to process.

[options]

Use the -d or --debug option to print the underlying FFmpeg commands that are being run.

-c, --crop

Crop the video to <width>,<height> or <x>,<y>,<width>,<height>.

# Crop to width 360, height 640
$ vdx '*.mov' --crop 360,640

# Crop to width 360, height 640, starting from coordinates (10, 20)
$ vdx '*.mov' --crop 10,20,360,640

-f, --format

Convert the video to a different file format.

# Convert to GIF
$ vdx '*.mov' --format gif

-fp, --fps

Change the frame rate of the video.

# Change the frame rate to 12
$ vdx '*.mov' --fps 12

--no-audio

Remove audio from the video.

# Remove audio
$ vdx '*.mov' --no-audio

-o, --output

Set the output directory. Defaults to ./build.

# Output files to './gifs'
$ vdx '*.mov' --format gif --output './gifs'

-p, --parallel

Set the maximum number of video files to process concurrently. Defaults to 3.

# Process up to 5 files concurrently
$ vdx '*.mov' --format gif --parallel 5

-r, --resize

Resize the video to <width>,<height>. Set either <width> or <height> to -1 to maintain the aspect ratio.

# Resize to width 360, height 640
$ vdx '*.mov' --resize 360,640

# Resize to width 360, maintaining the aspect ratio
$ vdx '*.mov' --resize 360,-1

# Resize to height 640, maintaining the aspect ratio
$ vdx '*.mov' --resize -1,640

-rv, --reverse

Reverse the video.

# Reverse
$ vdx '*.mov' --reverse

-ro, --rotate

Rotate the video by -90, 90, or 180 degrees.

# Rotate 90 degrees clockwise
$ vdx '*.mov' --rotate 90

# Rotate 90 degrees counter-clockwise
$ vdx '*.mov' --rotate -90

# Rotate 180 degrees
$ vdx '*.mov' --rotate 180

-s, --speed

Change the speed of the video. To slow down, set to a number greater than 0 and less than 1. To speed up, set to a number greater than 1.

# Halve the speed
$ vdx '*.mov' --speed 0.5

# Double the speed
$ vdx '*.mov' --speed 2

-t, --trim

Trim to <start>,<end> where <start> and <end> are timestamps in the format HH:MM or HH:MM.mmm. Omit <end> to trim from <start> to the end of the video.

# Trim from 0:05 to 0:10
$ vdx '*.mov' --trim 0:05,0:10

# Trim from 0:05 to the end of the video
$ vdx '*.mov' --trim 0:05

-vo, --volume

Change the volume of the video. To remove audio from the video, set to 0. To decrease the volume, set to a number greater than 0 and less than 1. To increase the volume, set to a number greater than 1.

# Remove audio from the video
$ vdx '*.mov' --volume 0

# Halve the volume
$ vdx '*.mov' --volume 0.5

# Double the volume
$ vdx '*.mov' --volume 2

Installation

$ npm install --global vdx

Prior art

See also

License

MIT