vdx
An intuitive CLI for processing video, powered by FFmpeg.
Last updated 2 years ago by yuanqing .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vdx 
SYNC missed versions from official npm registry.

vdx npm Version Build Status

An intuitive CLI for processing video, powered by FFmpeg.

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

Installation

Ensure that you have the latest versions of FFmpeg and Node.js installed. Then:

$ npm install --global vdx

Quick start

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          # Set the frame rate to 12
$ vdx '*.mov' --no-audio        # Strip audio
$ vdx '*.mov' --resize 360,-1   # Resize to width 360, maintaining 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 time 0:05 to 0:10
$ vdx '*.mov' --volume 0.5      # Halve the volume

Running multiple operations all at once is also supported:

$ 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 flag:

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

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

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

CLI

Usage: vdx [input] [options]

[input]

Globs of input files to process. Read from stdin if not specified.

[options]

-c, --crop [<x>,<y>,]<width>,<height>

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

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

-f, --format <format>

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

-fp, --fps <fps>

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

-na, --no-audio

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

-o, --output <directory>

<directory> defaults to './build'

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

-p, --parallel <concurrency>

<concurrency> defaults to 3

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

-r, --resize <width>,<height>

# 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

-ro, --rotate

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

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

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

-rv, --reverse

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

-s, --speed <speed>

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

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

-t, --trim <start>[,<end>]

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

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

-vo, --volume <volume>

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

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

Related

License

MIT

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

3 Versions

  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 1
Last Month 3
Dependencies (12)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |