|
VideoParser 0.2.0
C++ Video Bitstream Parsing Library
|
A command-line and API-based video bitstream parser, using ffmpeg and other third party libraries.
This project supplies two main components:
The project is aimed at providing input for bitstream-based video (quality) assessment.
Internally, ffmpeg is used, and linked into the project. Currently, the project is built with FFmpeg 8.1-dev (1407 commits from latest release).
We strive to keep the project up to date with the latest ffmpeg version. The actual ffmpeg changes are published in this ffmpeg fork in the videoparser branch.
For AV1 support, libaom is also vendored as a submodule. The code, including its changes, is mirrored at this libaom fork in the videoparser branch.
The project is using previous work from the bitstream_mode3_videoparser project, but written from the ground up to be faster.
The overall goal is to provide bitstream statistics to be later used for calculating video quality metrics such as ITU-T Rec. P.1204.3, which has a reference implementation available.
There are some design docs about this project available here. It explains the rationale for the creation of the project, the detailed statistics available in the bitstream_mode3_videoparser project we'd like to port over, and what we would like to add as features on top of that.
Go to releases and pick the right archive for your platform. Extract it, then run the video-parser binary.
Note for macOS: You might need to allow the binary to run. Try running it once from the Terminal, and you will run into a security notice. Then, go to System Preferences > Security & Privacy > General, and allow the binary. After that, you can run it from the Terminal again.
Continue with this guide to build from source.
We provide a pre-built Docker image on GitHub Container Registry. You can use it without building it yourself.
To pull the image, you need to have a valid GitHub token with access to the repository. If you don't have a token, create one here, and make sure it has read:packages scope enabled.
You will be prompted to enter your GitHub username, and as password, enter your personal access token. Once you have a token, you can pull the image, and rename it to videoparser-ng for easier use.
To run the CLI, run:
Or, for Docker, you must mount the video file into the container, e.g. to run it on test/test_video_h264.mkv, do:
Add the option -h for detailed usage.
The tool will print a set of line-delimited JSON records to STDOUT, either for per-sequence statistics, or per-frame statistics. These are denoted with the type field.
Example, but formatted with jq to make it more readable:
This would print:
The tool will also print various logs to STDERR which you can redirect to a file if you want to save them, or ignore with 2>/dev/null.
The following metadata/metrics are available:
Follow the instructions below to build the project from source.
You also need:
Note that you can skip the build step by just using the pre-built Docker image.
Xcode is required to compile software on your Mac. Install Xcode by downloading it from the website or using the Mac App Store.
After installing Xcode, install the Command Line Tools from Preferences > Downloads > Components. You can also install the tools via your shell:
Then, using Homebrew, install the required packages:
First clone all submodules:
Then build ffmpeg initially:
Then run the build script for the project:
This will create the library: build/VideoParser/libvideoparser.a
You can also run the CLI:
If you get a warning like:
Then run:
This will rebuild ffmpeg after which you can run the build script for the project again.
To build the project with Docker, run:
This will build the project and create a Docker image named videoparser-ng.
We have a more detailed guide for testing and the specific features implemented. See DEVELOPERS.md.
API documentation can be generated using Doxygen:
This requires doxygen to be installed. For better diagrams, also install graphviz:
After generation, open docs/html/index.html in your browser. On macOS, you can use:
If you use this project in your research, please reference this repository.
See CONTRIBUTING.md.
Copyright (c) AVEQ GmbH. Copyright (c) videoparser-ng contributors.
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, see https://www.gnu.org/licenses/.
Also, see the LICENSE.txt file for details on third-party licenses.