Perform motion search and compute motion vectors and residual information in order to extract features for predicting video compressibility.
Contents:
- CMake (>= 3.1)
clang-format
Under Linux, to install CMake, install the cmake
and clang-format
packages from your distribution's package manager.
Under macOS, you can install CMake using Homebrew:
brew install cmake clang-format
Create a build folder and run CMake, then make
:
mkdir build
cd build
cmake ..
make -j $(nproc)
The motion-search
executable will be created in the build/bin
folder.
The basic usage is:
motion-search <input> -W=<width> -H=<height> <output>
For example:
motion-search input.yuv -W=1920 -H=1080 stats.txt
The input file must be a .yuv
or .y4m
file.
The output file will be a CSV file containing the following columns:
picNum
: picture numberpicType
: picture type (I, P, B)count_I
: number of I blockscount_P
: number of P blockscount_B
: number of B blockserror
: mean squared errorbits
: number of bits estimated
The tool will print extra information to stderr, such as the number of frames processed, per-GOP stats, and total algorithm execution time.
You can use -g
to control GOP size (default 150), -n
to control
number of frames to read (default is to read all) and -b
to control
number of consecutive B-frames in subgop (default 0).
See motion-search -h
for more information.
Note that currently when using B-frames:
- code may read more than requested number of frames to complete last subgop
- if there aren't enough frames to complete last subgop then trailing frames after the previous complete subgop will be ignored
This source code is licensed under the BSD3 license found in the LICENSE file in the root directory of this source tree.