vc2-bitstream-validator

A command-line utility for validating VC-2 bitstreams’ conformance with the VC-2 specification and providing a reference decoding of the pictures within.

Usage

This command should be passed a filename containing a candidate VC-2 bitstream. For example, given a valid stream:

$ vc2-bitstream-validator path/to/bitstream.vc2 --output decoded_picture_%d.raw
No errors found in bitstream. Verify decoded pictures to confirm conformance.

Here the --output argument specifies the printf-style template for the decoded picture filenames. The decoded pictures are written as raw files (see Video file format).

If a conformance error is detected, a detailed explanation of the problem is displayed:

$ vc2-bitstream-validator invalid.vc2
Conformance error at bit offset 104
===================================

Non-zero previous_parse_offset, 5789784, in the parse info at the start of
a sequence (10.5.1).


Details
-------

Was this parse info block copied from another stream without the
previous_parse_offset being updated?

Does this parse info block incorrectly include an offset into an adjacent
sequence?


Suggested bitstream viewer commands
-----------------------------------

To view the offending part of the bitstream:

    vc2-bitstream-viewer invalid.vc2 --offset 104


Pseudocode traceback
--------------------

Most recent call last:

* parse_stream (10.3)
  * parse_sequence (10.4.1)
    * parse_info (10.5.1)

vc2-bitstream-validator: error: non-conformant bitstream (see above)

Errors include an explanation of the conformance problem (along with references to the VC-2 standards documents) along with possible causes of the error. Additionally, a sample invocation of vc2-bitstream-viewer is given which can be used to display the contents of the bitstream at the offending position. Finally, a stack trace for the VC-2 pseudocode functions involved in parsing the stream at the point of failure is also printed.

Arguments

The complete set of arguments can be listed using --help

usage: vc2-bitstream-validator [-h] [--version] [--no-status] [--verbose]
                               [--output OUTPUT]
                               bitstream

Validate a bitstream's conformance with the VC-2 specifications.

positional arguments:
  bitstream             The filename of the bitstream to validate.

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --no-status, --quiet, -q
                        Do not display a status line on stderr while
                        validating the bitstream.
  --verbose, -v         Show full Python stack-traces on failure.
  --output OUTPUT, -o OUTPUT
                        The filename pattern for decoded picture data and
                        metadata. The supplied pattern should a 'printf' style
                        template with (e.g.) '%d' where an index will be
                        substituted. The first decoded picture will be
                        assigned index '0', the second '1' and so on -- i.e.
                        these indices are unrelated to the picture number. The
                        file extension supplied will be stripped and two files
                        will be written for each decoded picture: a '.raw'
                        planar image file and a '.json' JSON metadata file.
                        (Default: picture_%d.raw).