• Stars
    star
    1,659
  • Rank 27,153 (Top 0.6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🎞️ An intuitive CLI for processing video, powered by FFmpeg

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

More Repositories

1

charming

🎩 Lettering.js in vanilla JavaScript
JavaScript
1,003
star
2

create-figma-plugin

🔋 The comprehensive toolkit for developing plugins and widgets for Figma and FigJam
TypeScript
867
star
3

malarkey

⌨️ Simulate a typewriter effect in vanilla JavaScript.
JavaScript
238
star
4

figma-plugins

🔥 Monorepo for my Figma plugins
TypeScript
228
star
5

ffmpeg-cheatsheet

📼 A cheatsheet for common video processing operations in FFmpeg
175
star
6

load-google-maps-api

🌏 A lightweight Promise-returning helper for loading the Google Maps JavaScript API
JavaScript
170
star
7

vim-basics

✌️ Just the basics to get you up and running with Vim
Vim Script
133
star
8

stable-diffusion-rest-api

🤗 Run Stable Diffusion locally via a REST API on an M1/M2 MacBook
TypeScript
124
star
9

line-clamp

🗜️ Line clamp a DOM element in vanilla JavaScript
JavaScript
75
star
10

autosize-input

🎈 Effortless, dynamic-width text boxes in vanilla JavaScript
JavaScript
67
star
11

figma-plugins-stats

📈 A CLI to get live and historical stats for your Figma plugins
TypeScript
60
star
12

cuba

🇨🇺 Google Sheets + SQL = JSON
JavaScript
53
star
13

single-page-markdown-website

🌶️ Create a nice single-page documentation website from one or more Markdown files
TypeScript
44
star
14

menu-aim

🎯 Instant mega menus in vanilla JavaScript.
JavaScript
39
star
15

fastmatter

👀 A fast frontmatter parser. Supports both string and stream inputs.
JavaScript
28
star
16

awesome-create-figma-plugin

27
star
17

generate-css

💥 Dynamically generate functional CSS classes from HTML and JavaScript source files
TypeScript
16
star
18

stoke

🌲 Generate the Abstract Syntax Tree (AST) of a Bash command
JavaScript
15
star
19

regular-expressions-cheatsheet

🅰️ A concise cheatsheet for using Regular Expressions in JavaScript
JavaScript
15
star
20

gulp-tape

👻 Run Tape tests in Gulp.
JavaScript
14
star
21

generate-ts-docs

📘 Utilities to parse type information and JSDoc annotations from TypeScript source files, and render Markdown documentation
TypeScript
12
star
22

macos-keyboard-shortcuts

⌨️ A CLI to set application-specific keyboard shortcuts for macOS
TypeScript
12
star
23

shell-basics

🐚 A quick overview of the Unix shell
11
star
24

rdd

📝 Preview your Markdown locally as it would appear on GitHub, with live updating
JavaScript
11
star
25

code-problems

🐫 Working through code problems in OCaml
OCaml
7
star
26

git-cheatsheet

🌳 A handy list of commonly used Git commands
6
star
27

interpolate

Simple string interpolation in PHP.
PHP
5
star
28

sketch-plugin-helper

Utilities to help you make Sketch plugins
JavaScript
5
star
29

sketch-plugins

Monorepo for my Sketch plugins
JavaScript
5
star
30

quine

✍️ Programs that write themselves.
Shell
5
star
31

grouper

Assign objects to groups by one or more properties, by object value, or by using a comparator function.
JavaScript
4
star
32

modal

Super-simple modals in vanilla JavaScript.
JavaScript
4
star
33

react-redux-modal

🔮 A React modal bound to the Redux store.
JavaScript
4
star
34

yuanqing.sg

⚪ My personal website
HTML
3
star
35

widget

TypeScript
3
star
36

sketch-handbook

📙 A concise handbook on working precisely and effectively in Sketch
Shell
3
star
37

figma-plugins-monetization-stats

JavaScript
3
star
38

figma-add-auto-layout-item

TypeScript
2
star
39

versus

Compare two variables with the comparison operator specified as a string.
JavaScript
2
star
40

google-sheets-rest-api

JavaScript
2
star
41

q

🍦 An opinionated CLI for creating lightweight, vanilla HTML/CSS websites
JavaScript
2
star
42

jockey

Modelling a playlist that supports shuffle, repeat, and reordering.
JavaScript
2
star
43

xoxo

🎧 A YouTube mixtape maker thing.
JavaScript
2
star
44

extract

Sugar for getting data out of strings in PHP.
PHP
2
star
45

asset-versioning

🗃️ Version your assets by appending a hash to the filename.
JavaScript
2
star
46

fi

Query a collection of text files like a document database in PHP.
PHP
2
star
47

Q.js

A micro JavaScript library.
JavaScript
2
star
48

shared-event-listeners

A utility for minimising the number of event listeners bound on a given DOM element.
JavaScript
2
star
49

create-figma-plugin-react-example

JavaScript
2
star
50

sketch-add-artboard-borders-and-titles

JavaScript
2
star
51

figmake

🍦 A tiny CLI for making Figma plugins in HTML, CSS, and vanilla JavaScript
TypeScript
2
star
52

savoy

Higher-order functions (synchronous and asynchronous each/eachSeries/map/filter/fold) and functions for flow control (parallel/series/waterfall) in under 1 KB.
JavaScript
1
star
53

string-extractor

Regular expression sugar for getting data out of strings.
JavaScript
1
star
54

cli

TypeScript
1
star
55

cors

JavaScript
1
star
56

kontact

An extensible contact form in PHP and vanilla JavaScript/AJAX.
JavaScript
1
star
57

abstract-backup

💾 Download a local backup of the Sketch files from all your Abstract projects
JavaScript
1
star
58

sketch-sort-layer-list

JavaScript
1
star
59

clinical

💊 A minimum-viable arguments parser in ~90 LOC with zero dependencies
TypeScript
1
star
60

sketch-select-layers

JavaScript
1
star
61

npm-boilerplate

Barebones boilerplate using `npm run-script`.
JavaScript
1
star
62

google-sheets

🍃 An easier interface to read from and write to Google Sheets
JavaScript
1
star
63

sketch-clean-document

JavaScript
1
star
64

gulp-boilerplate

A Gulp-powered boilerplate for Node and JavaScript projects.
JavaScript
1
star
65

segue

Enqueue functions, and call them in series.
JavaScript
1
star
66

unfurl

Extract the query string and hash of a URL.
JavaScript
1
star
67

sketch-extract-text

JavaScript
1
star
68

bbqr

JavaScript
1
star
69

sketch-move-layers

JavaScript
1
star
70

pppath

Join strings to form a valid file path.
JavaScript
1
star
71

screen-recorder

JavaScript
1
star
72

simple-code-editor

TypeScript
1
star
73

resizable

TypeScript
1
star
74

svg-inserter

TypeScript
1
star
75

build-website

TypeScript
1
star
76

.github

1
star
77

eslint-config-yuanqing

⚙️ An opinionated ESLint configuration for TypeScript and Preact projects
JavaScript
1
star
78

append-js-extension-to-local-imports

JavaScript
1
star
79

stylelint-config-yuanqing

🕴️ An opinionated stylelint configuration
JavaScript
1
star
80

sketch-draw-slice-over-selection

JavaScript
1
star
81

sketch-align-to-grid

JavaScript
1
star
82

frontend-boilerplate

🌱 Super basic web boilerplate with Sass and vanilla JavaScript.
HTML
1
star
83

isomorphic

JavaScript
1
star
84

tsu

Utilities and functional wrappers over `through2`.
JavaScript
1
star
85

sketch-rename-layers

🖋️ [WIP] A Sketch plugin to automate layer renaming
JavaScript
1
star
86

johnson-trotter

An implementation of the Johnson-Trotter permutation algorithm.
JavaScript
1
star
87

rectify

Unsmarten your quotes, dashes, and ellipses.
JavaScript
1
star
88

react-autocomplete

[UNMAINTAINED] React autocomplete component with an opinionated UX.
JavaScript
1
star