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
$ 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 # 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
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
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
Usage: vdx <pattern> [options]
One or more globs of input files to process.
Use the -d
or --debug
flag to print the underlying FFmpeg commands that are being run.
<x>
and <y>
both default to 0
.
# 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
# Convert to GIF
$ vdx '*.mov' --format gif
# Change the frame rate to 12
$ vdx '*.mov' --fps=12
# Strip audio
$ vdx '*.mov' --no-audio
<directory>
defaults to './build'
.
# Output files to './gifs'
$ vdx '*.mov' --format=gif --output='./gifs'
<concurrency>
defaults to 3
.
# Process up to 5 files concurrently
$ vdx '*.mov' --format=gif --parallel=5
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
# Reverse
$ vdx '*.mov' --reverse
<angle>
must be one of -90
, 90
, or 180
.
# Rotate 90 degrees clockwise
$ vdx '*.mov' --rotate=90
# Rotate 90 degrees counter-clockwise
$ vdx '*.mov' --rotate=-90
# Rotate 180 degrees
$ vdx '*.mov' --rotate=180
# Halve the speed
$ vdx '*.mov' --speed=0.5
# Double the speed
$ vdx '*.mov' --speed=2
Omit <end>
to trim from <start>
to the end of the input file.
# 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
# Halve the volume
$ vdx '*.mov' --volume=0.5
# Double the volume
$ vdx '*.mov' --volume=2
$ npm install --global vdx