Skip to main content

A CLI utility and samples for creation of sample media and temporal metadata tracks for use with the Omakase Player framework

Project description

Omakase Player Command Line Utility

This PIP package provides a command line utility for use with the reference implementation of the Omakase Player open source project.

The CLI utility may be used to generate temporal metadata tracks for use with the Omakase Player framework.

The Python script 'create_omp_tracks' is used for creating Omakase Player temporal metadata tracks from source media files. The script is capable of generating the following types of metadata tracks:

  • Audio Metric Analysis Tracks using the create_omp_tracks --audio-metrics CLI option
  • Audio Waveform Analysis Tracks using the create_omp_tracks --waveforms CLI option
  • Video Bitrate Analysis Tracks using the create_omp_tracks --video-bitrate CLI option
  • Video Thumbnail Tracks using the create_omp_tracks --thumbnails CLI option

The create_omp_tracks utility is provided to help demonstrate the capabilities of the Omakase Player framework and to bootstrap small POC projects. The CLI utility is provided as-is and are not intended to be used in a production environments.

The reference implementation of the reference player can be found in GitHub at omakase-player.

Contents:

  • Requirements
  • Installation
  • Usage
    • Usage create_omp_tracks --thumbnails
    • Usage create_omp_tracks --video-bitrate
    • Usage create_omp_tracks --audio-metrics
    • Usage create_omp_tracks --waveforms
  • External Links
  • License

Requirements


Python

  • Python 3.6 or higher

ffmpeg

  • Download a static build from the ffmpeg website and install using the instructions for your platform.
  • Ensure that the ffmpeg executable is in your path.

audiowaveform

audiowaveform is a C++ program that takes an audio file and generates raw waveform data from it.

This data is then used to generate an OMP v1.0 VTT file containing the waveform metadata needed by the Omakase Player.

ffmpeg-bitrate-stats

The ffmpeg-bitrate-stats Python package is used to generate raw video bitrate metrics, when are then processed to create an OMP v1.0 VTT file for use with Omakase Player.

  • Install the ffmpeg-bitrate-stats Python package from the following GitHub repository: ffmpeg-bitrate-stats

Installation


  • Install the PIP package omp-media-tools from PyPi.

Usage


The Python script create_omp_tracks is a command line utility that can generate Omakase Player temporal metadata tracks from source media files. It is capable of generating the following types of metadata tracks:

  • Audio Metric Analysis Tracks using the create_omp_tracks --audio-metrics CLI option
  • Audio Waveform Analysis Tracks using the create_omp_tracks --waveforms CLI option
  • Video Bitrate Analysis Tracks using the create_omp_tracks --video-bitrate CLI option
  • Video Thumbnail Tracks using the create_omp_tracks --thumbnails CLI option

Usage create_omp_tracks --thumbnails

A thumbnail timeline metadata track and series of thumbnail images, can be generated with this option.

An input video file must be specified and the VTT and image files generated are written to the output directory specified.

The frequency of the thumbnails is controlled by the --seconds-interval CLI option.

usage: create_omp_tracks [-h] [-v] --thumbnails -i INPUT_FILE -o OUTPUT_DIR [-s {1,2,3,4,5,10,12,15}]

Create OMP thumbnail timeline metadata track.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output
  -t, --thumbnails      Create thumbnail track
  -i INPUT_FILE, --input-file INPUT_FILE
                        Input file
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory
  -s {1,2,3,4,5,10,12,15}, --seconds-interval {1,2,3,4,5,10,12,15}
                        Seconds between video bitrate samples or video thumbnails

Example - Thumbnail Timeline Metadata Track

WEBVTT

00:00:00.000 --> 00:00:01.999
tearsofsteel_4k00001.jpg

00:00:02.000 --> 00:00:03.999
tearsofsteel_4k00002.jpg

Usage create_omp_tracks --video-bitrate

A metadata track of the video bitrate can be generated with this option. The resulting metadata track can then be used to visualize the video bitrate as a line chart on the Omakase Player timeline.

usage: create_omp_tracks [-h] [-v] --video-bitrate -i INPUT_FILE -o OUTPUT_DIR [-s {1,2,3,4,5,10,12,15}]

Create OMP video bitrate metadata track.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output
  -t, --video-bitrate   Create video bitrate track
  -i INPUT_FILE, --input-file INPUT_FILE
                        Input file
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory
  -s {1,2,3,4,5,10,12,15}, --seconds-interval {1,2,3,4,5,10,12,15}
                        Seconds between video bitrate samples or video thumbnails

An input video file must be specified and the VTT and image files generated are written to the output directory specified.

The resolution of the bitrate samples is controlled by the --seconds-interval CLI option.

Example - Video Bitrate Metadata Track

WEBVTT

NOTE
Omakase Player Web VTT
V1.0

00:00:00.000 --> 00:00:01.999
276.39:MEASUREMENT=avg:COMMENT=2-sec interval

Please Note: The OMP v1.0 VTT file format is a standard WebVTT file with the following additional metadata:

  • The :MEASUREMENT=<metric name> tag is optional and can be used to specify the video bitrate metric.
  • The :COMMENT=<comment> tag is optional indicates the sample interval for the bitrate metric.

The optional tags are used by the Omakase Player to provide telemetry metadata for the video bitrate metric as the video is played.

Usage create_omp_tracks --audio-metrics

Audio metrics can be generated for an audio tracks, or all audio tracks, with this CLI option. At present, two audio metric metadata tracks are created for each audio file:

  • RMS Levels using the ffmpeg ametadata filter
  • R128 Momentary Loudness also using the ametadata filter

If --input-dir is used, all of the wav and aac files in the current directory are processed. If --input-file is used, only the audio file specified is processed.

The resulting metadata tracks are named with the basename of the audio file and appended with R128_2-SEC or RMS_2-SEC respectively. All files are written to the directory specified with --output-dir.

At present, the metrics are calculated as an average over a two-second interval.

usage: create_omp_tracks [-h] [-v] --audio-metrics (-i INPUT_FILE | -d INPUT_DIR) -o OUTPUT_DIR

Create OMP audio metric metadata tracks.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output
  -t, --video-bitrate   Create video bitrate track
  -i INPUT_FILE, --input-file INPUT_FILE
                        Input file
  -d INPUT_DIR, --input-dir INPUT_DIR
                        Input directory of files
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory

Example - Audio Metrics Metadata Track

WEBVTT

NOTE
Omakase Player Web VTT
V1.0

00:00:00.000 --> 00:00:01.999
-56.033:MEASUREMENT=lavfi.r128.M:COMMENT=2-sec avg

Please Note: The OMP v1.0 VTT file format is a standard WebVTT file with the following additional metadata:

  • The :MEASUREMENT=<metric name> tag is optional and can be used to specify the audio metric type.
  • The :COMMENT=<comment> tag is optional and can be used to provide additional information about the audio metric.

The optional tags are used by the Omakase Player to provide telemetry metadata for the audio metric as the video is played.

Usage create_omp_tracks --waveforms

The --waveforms option generates audio waveform metadata tracks that can be used to provide an audio waveform visualization in Omakase Player.

Waveform metadata can be generated for a single audio track, or all audio tracks, with this CLI option. The generated waveform includes the entire soundfield, but individual channels can be visualized with a dual-mono audio track for each channel.

If --input-dir is used, all of the wav and aac files in the current directory are processed. If --input-file is used, only the audio file specified is processed.

The resulting metadata tracks are named with the basename of the audio file All files are written to the directory specified with --output-dir.

At present, the metrics are calculated as an average over a 1-second interval.

usage: create_omp_tracks [-h] [-v] --waveforms (-i INPUT_FILE | -d INPUT_DIR) -o OUTPUT_DIR

Create OMP audio waveform metadata tracks.

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose output
  -t, --video-bitrate   Create video bitrate track
  -i INPUT_FILE, --input-file INPUT_FILE
                        Input file
  -d INPUT_DIR, --input-dir INPUT_DIR
                        Input directory of files
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Output directory

Example - Audio Waveform Metadata Track

WEBVTT
  
00:00:00.000 --> 00:00:00.999
-0.0101, 0.0108

External Links


License


create_omp_tracks, Copyright 2024 ByOmakase, LLC (https://byomakase.org)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omakase_media_tools-0.1.5.tar.gz (77.5 kB view details)

Uploaded Source

Built Distribution

omakase_media_tools-0.1.5-py3-none-any.whl (79.2 kB view details)

Uploaded Python 3

File details

Details for the file omakase_media_tools-0.1.5.tar.gz.

File metadata

  • Download URL: omakase_media_tools-0.1.5.tar.gz
  • Upload date:
  • Size: 77.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for omakase_media_tools-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bbab2ca7605eaedbc6231a71b8b4172c30a1a9c95ff7827de277cf52c0d22f68
MD5 e50b3dab0e83cd12447847dc558eaa1e
BLAKE2b-256 6f571990f6f8a1f05be825e0069bb20a76cad9818fec7ea40713be3f3e531c1e

See more details on using hashes here.

File details

Details for the file omakase_media_tools-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for omakase_media_tools-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c8200879962a02ad6cdc56482d71d2bd360e0acbb47e68dc35f2cc7e12f9a590
MD5 b726fd173dc916947426396ed4bb4b4d
BLAKE2b-256 b6f56a373bde8d5f3c59a5df36d0a3b33e7a0b38ad2345d477982b195f0c88d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page