cta-wave / mezzanine

This repo contains scripts that will build annotated test content from specific source content, compatible with the WAVE device playback test suite.
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

About this Repo

This repo holds code and associated elements for automatically generating annotated WAVE mezzanine content from raw source material. The annotations in the resulting multimedia files are used by the WAVE test suite to programmatically identify content parameters and to verify various elements of performance. The WAVE Project is an industry interoperability effort for streaming internet video supported by over 60 companies and hosted by the Consumer Technology Association. For more information on the WAVE Project, the WAVE test suite, please see CTA.tech/WAVE or email standards@CTA.tech.”

Contents

  1. Creating annotated WAVE mezzanine content
  2. Generating all annotated WAVE mezzanine content
  3. Experimental scripts

Creating annotated WAVE mezzanine content

The steps to create annotated WAVE mezzanine content have been combined into a single Python script mezzanine.py.

The mezzanine.py script does the following to the source content:

Requirements:

Using the provided requirements.txt, execute the following to install the Python dependencies: pip install -r requirements.txt

Associated assets:

Tools:

Mezzanine sources:

For example, you can execute the following command to produce an annotated mezzanine file:
py mezzanine.py --duration 60 --framerate 30 --label J1 --qr-positions 4 --resolution 1280x720 --seek 00:01:25 --start-end-indicators enabled --font assets/Cousine-Regular.ttf --window-len 6 --tonemap disabled --version 2 --spec-version 1 --metadata-only disabled source/tearsofsteel_4k.mov _mezzanine/tos_J1_1280x720@30_60.mp4

The full details of the available commands for the script can be found by executing py mezzanine.py -h

Generating all annotated WAVE mezzanine content

The metamezz.py Python script enables generation of multiple annotated mezzanine streams with a single command, using mezzanine.py to generate each annotated mezzanine file.

The requirements for metamezz.py are the same as for mezzanine.py.

At least one source file and an output file prefix pair must be specified, for example: py metamezz.py source1.mov source1_output_prefix

Additional parameters determine the specific annotated mezzanine files to generate (see further).

WAVE annotated mezzanine filenames use the following template: <prefix>_<label>_<WxH>@<fps>_<duration>.mp4

Where:

For example: croatia_O2_3840x2160@50_60.mp4 or tos_L1_1920x1080@60_60.mp4

To generate a complete set of WAVE mezzanine content you can execute the following 2 commands:

py metamezz.py "source\tearsofsteel_4k.mov" _mezzanine\tos "source\tearsofsteel_4k.mov" _mezzanine\tos "source\DVB_PQ10_VandV.mov" _mezzanine\croatia -rjf rjf\resolutions_15_30_60_fractional.json rjf\resolutions_15_30_60_non-fractional.json rjf\resolutions_12.5_25_50.json --tonemap disabled disabled enabled --spec-version 1 --version 2

py metamezz.py "source\tearsofsteel_4k.mov" _mezzanine\splice_main_tos "source\tearsofsteel_4k.mov" _mezzanine\splice_main_tos "source\DVB_PQ10_VandV.mov" _mezzanine\splice_main_croatia "source\Big Buck Bunny trailer_1080p30.mp4" _mezzanine\splice_ad_bbb "source\Big Buck Bunny trailer_1080p30.mp4" _mezzanine\splice_ad_bbb "source\Big Buck Bunny trailer_1080p.mov" _mezzanine\splice_ad_bbb -rjf rjf\splice_main_resolutions_30_fractional.json rjf\splice_main_resolutions_30_non-fractional.json rjf\splice_main_resolutions_25.json rjf\splice_ad_resolutions_30_fractional.json rjf\splice_ad_resolutions_30_non-fractional.json rjf\splice_ad_resolutions_25.json --tonemap disabled disabled enabled disabled disabled disabled --spec-version 1 --version 2

This assumes the source files are located in the source folder, and the JSON files in the rjf folder. The annotated mezzanine files generated are saved to the _mezzanine folder, with the prefixes tos and croatia for the main mezzanine content, and with the prefixes splice_main_tos, splice_main_croatia and splice_ad_bbb for the splicing mezzanine content. Tone-mapping is enabled for the croatia content, as the source is HDR, but the desired output for the mezzanine content is SDR. The mezzanine release version is set to 2, and the corresponding WAVE Test Content Format Specification version is set to 1.

The following set of JSON files is used to generate all WAVE annotated mezzanine content. These JSON files are passed to metamezz.py using the -rjf parameter.

The JSON structure used is: { "WIDTHxHEIGHT" : [ [framerate (str), duration in seconds (float), starting position in source (str, HH:MM:SS), label (str), number of variants (int), add second audio track (bool)], [...] ]}

Multiple combinations of frame rate, duration, start position, label and variants (with/without second audio track) can be defined for each resolution.

Details of the available commands for the script can be obtained by executing py metamezz.py -h

Here is a brief description of the parameters:

The metamezz.py script uses the following parameter defaults that can only be modified in the script, as they are not expected to be changed often, for consistency reasons:

Experimental scripts

Adding a second audio track to a mezzanine stream

The add_second_audio_track.py Python script uses the pyttsx3 library to create an audio file with the spoken audio "English". This is mixed with the original audio of a mezzanine file, repeating the spoken audio every 15 seconds.

The script makes a copy of a mezzanine file, incorporating the new audio track as a second audio track. The first audio track remains the same as in the original mezzanine file.

The output file naming convention is as follows: <mezzanine_stream_name>_2ndAudio[English].<mezzanine_stream_file_extension>

Usage example: add_second_audio_track.py tos_A1_480x270@30_60.mp4 creates tos_A1_480x270@30_60_2ndAudio[English].mp4

Additional requirements: