https://github.com/tableflip/video-dimensions
A simple command line tool to find the width and height a video
https://github.com/tableflip/video-dimensions
Last synced: about 1 year ago
JSON representation
A simple command line tool to find the width and height a video
- Host: GitHub
- URL: https://github.com/tableflip/video-dimensions
- Owner: tableflip
- License: agpl-3.0
- Created: 2016-02-02T13:20:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-02T13:48:50.000Z (over 10 years ago)
- Last Synced: 2025-03-16T08:16:47.881Z (over 1 year ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# video-dimensions
**A simple command line tool to find the width and height a video**
## Install
```sh
npm install -g get-video-dimensions-cli
```
This tool requires `ffprobe` to do the hard work, which is part of `ffmpeg`
You could:
```sh
brew install ffmpeg
```
but you can replace `brew` with your package manager of choice.
## Usage
```sh
video-dimensions foo.mp4
{"name":"foo.mp4","width":690,"height":420}
```
Output is json to make downstream parsing easier, for something like [`JSONstream`](https://github.com/dominictarr/JSONStream)
**Find all the dimensions of videos in a directory**
```
find . -name "*.mp4" -exec video-dimensions {} \;
```
`find` is ace. The above will find all the files with the `.mp4` extension in the current directory `.`, and run video-dimensions on each one.
`{}` is a placeholder for a single filename, and the `\;` is used to tell `-exec` that that's the end of the command.
## Credits
- [`ffmpeg`](https://www.ffmpeg.org/) digs the info out of the videos and provides `ffprobe`
- [`get-video-dimensions`](https://github.com/mgmtio/get-video-dimensions) - talks to `ffprobe` from node.
---
A [(╯°□°)╯︵TABLEFLIP](https://tableflip.io) side project.