Improve README
This commit is contained in:
@@ -1,19 +1,76 @@
|
|||||||
# js-vmaf: Simple, but effective VMAF comparison tool
|
# js-vmaf: Simple, but effective VMAF comparison tool
|
||||||
This is a simple wrapper around FFmpeg and VMAF to handle comparison of files.
|
This is a simple wrapper around FFmpeg and VMAF to handle comparison of files.
|
||||||
|
|
||||||
|
```
|
||||||
|
$node . --help
|
||||||
|
usage: js-vmaf [--help] [--hide_banner] [-q] [-v] --ffmpeg FFMPEG --ffprobe FFPROBE [--vmaf VMAF] -r
|
||||||
|
REFERENCE [-o OUTPUT] [--flip] [-cs COLOR_SPACE] [-cp COLOR_PRIMARIES] [-ct COLOR_TRC]
|
||||||
|
[-cr COLOR_RANGE] [-p FORMAT] [-w WIDTH] [-h HEIGHT] [--fps FPS] [-f FEATURE] [-m MODEL]
|
||||||
|
[-t THREADS]
|
||||||
|
Path [Path ...]
|
||||||
|
|
||||||
|
A simple, yet effective tool to quickly compare one or more videos using VMAF.
|
||||||
|
|
||||||
|
positional arguments:
|
||||||
|
Path One or more paths to a distorted file or a directory containing distorted files.
|
||||||
|
|
||||||
|
optional arguments:
|
||||||
|
--help show this help message and exit
|
||||||
|
--hide_banner Hide license banner.
|
||||||
|
-q, --quiet Be quiet.
|
||||||
|
-v, --verbose Be verbose.
|
||||||
|
--ffmpeg FFMPEG Path to the FFmpeg binary to use.
|
||||||
|
--ffprobe FFPROBE Path to the FFprobe binary to use.
|
||||||
|
--vmaf VMAF Path to the VMAF binary to use. Will fall back to FFmpeg if not provided
|
||||||
|
-r REFERENCE, --reference REFERENCE
|
||||||
|
Reference file
|
||||||
|
-o OUTPUT, --output OUTPUT
|
||||||
|
The file name, including formatters, for the output log file.
|
||||||
|
--flip Scale, convert and resample to distorted file instead of reference file.
|
||||||
|
-cs COLOR_SPACE, --color_space COLOR_SPACE
|
||||||
|
Define the color space of the reference file.
|
||||||
|
-cp COLOR_PRIMARIES, --color_primaries COLOR_PRIMARIES
|
||||||
|
Define the color primaries of the reference file.
|
||||||
|
-ct COLOR_TRC, --color_trc COLOR_TRC
|
||||||
|
Define the color transfer characteristics of the reference file.
|
||||||
|
-cr COLOR_RANGE, --color_range COLOR_RANGE
|
||||||
|
Define the color range of the reference file.
|
||||||
|
-p FORMAT, --format FORMAT
|
||||||
|
Define the format for comparison.
|
||||||
|
-w WIDTH, --width WIDTH
|
||||||
|
Define the width for the comparision.
|
||||||
|
-h HEIGHT, --height HEIGHT
|
||||||
|
Define the height for the comparision.
|
||||||
|
--fps FPS Define the FPS for comparison.
|
||||||
|
-f FEATURE, --feature FEATURE
|
||||||
|
Enable (and configure) a feature
|
||||||
|
-m MODEL, --model MODEL
|
||||||
|
Enable (and configure) a model
|
||||||
|
-t THREADS, --threads THREADS
|
||||||
|
Number of threads to use.
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Examples
|
||||||
|
|
||||||
|
##### Compare all files in a directory
|
||||||
```
|
```
|
||||||
node . --help
|
$(prog) --ffmpeg ffmpeg --ffprobe ffprobe -r /mnt/usb0/ref.mp4 /mnt/usb1/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
##### Use the distorted files as the target size
|
||||||
### Compare all files in a directory
|
The following command converts the reference to the same format, resolution, framerate and color as the distorted files. Ideal for bitrate optimization.
|
||||||
```
|
```
|
||||||
node . --ffmpeg ./ffmpeg --ffprobe ./ffprobe -r /mnt/usb0/reference.mp4 /mnt/usb1/
|
$(prog) --ffmpeg ffmpeg --ffprobe ffprobe --flip -r /mnt/usb0/ref.mp4 /mnt/usb1/
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Resize everything to 1080p and convert to yuv420p
|
||||||
|
```
|
||||||
|
$(prog) --ffmpeg ffmpeg --ffprobe ffprobe -h 1080 -p yuv420p -r /mnt/usb0/ref.mp4 /mnt/usb1/
|
||||||
```
|
```
|
||||||
|
|||||||
+2
-2
@@ -298,7 +298,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AN
|
|||||||
|
|
||||||
// Convert format.
|
// Convert format.
|
||||||
if (this._args.format || (this._ref.video[0].pix_fmt !== fref.video[0].pix_fmt)) {
|
if (this._args.format || (this._ref.video[0].pix_fmt !== fref.video[0].pix_fmt)) {
|
||||||
chain.push(`format=pix_fmts=${valueOrDefault(this._args.format, valueOrDefault(fref.video[0].pix_fmt, "yuv420p"))}`)
|
chain.push(`format=pix_fmts=${valueOrDefault(this._args.format, valueOrDefault(fref.video[0].pix_fmt, "yuv420p"))}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
filters.push(`[0:v:0]${chain.join(",")}[ref]`);
|
filters.push(`[0:v:0]${chain.join(",")}[ref]`);
|
||||||
@@ -355,7 +355,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AN
|
|||||||
|
|
||||||
// Convert format.
|
// Convert format.
|
||||||
if (this._args.format || (cmp.video[0].pix_fmt !== fref.video[0].pix_fmt)) {
|
if (this._args.format || (cmp.video[0].pix_fmt !== fref.video[0].pix_fmt)) {
|
||||||
chain.push(`format=pix_fmts=${valueOrDefault(this._args.format, valueOrDefault(fref.video[0].pix_fmt, "yuv420p"))}`)
|
chain.push(`format=pix_fmts=${valueOrDefault(this._args.format, valueOrDefault(fref.video[0].pix_fmt, "yuv420p"))}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
filters.push(`[1:v:0]${chain.join(",")}[dst]`);
|
filters.push(`[1:v:0]${chain.join(",")}[dst]`);
|
||||||
|
|||||||
Reference in New Issue
Block a user