AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

Support for binary encoded SMPTE time codes

Open
#791 0 comments 0 reactions 0 assignees View on GitHub
stale time calculations
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

## Feature Request

- [x] New Feature
- [ ] Change Existing Behavior

## Description

OTIO currently supports ASCII encodings for SMPTE time codes, but does not provide conversion utilities for binary encoding. Add conversion between RationalTime and binary SMPTE time codes.

## Context

Information on the timecoding is available here: https://en.wikipedia.org/wiki/SMPTE_timecode

OpenImageIO returns TimeCode as a set of ints encoded like this for some image formats: https://github.com/OpenImageIO/oiio/blob/3082bd7f2a33fc2353d2ceefb13b72cdffbc6cc5/src/libutil/typedesc.cpp#L478
https://github.com/OpenImageIO/oiio/blob/3082bd7f2a33fc2353d2ceefb13b72cdffbc6cc5/src/libutil/typedesc.cpp#L530

OpenEXR has a treatment here:
https://github.com/AcademySoftwareFoundation/openexr/blob/master/OpenEXR/IlmImf/ImfTimeCode.cpp

ffmpeg:
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/refs/heads/master:/libavutil/timecode.c

h/t @apetrynet for the research.

Looking at the different implementations, EXR’s seems the most thorough in terms of implementing the spec and intepreting the different fields. ffmpeg’s is concise but not complete and also burdened by the GPL. OIIO seems to dial in on the image relevant bits, as opposed to the image sequence/fields relevant bits.

I’d suggest forking EXR’s and writing it to be dependency and exception free.

We could write it directly into OTIO's RationalTime, or we could look to share code with the OpenEXR project.

One of the GSOC OpenEXR deliverables was to split Imath. https://github.com/AcademySoftwareFoundation/Imath

A possible path forward is to migrate ImfTimeCode.h/cpp to Imath, and utilize Imath within OTIO. Pinging some OpenEXR alumni for comment: @cary-ilm @kdt3rd @peterhillman @lgritz

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked OpenEXR ImfTimeCode.cpp, OIIO typedesc.cpp, and FFmpeg timecode.c implementations and comparing their binary SMPTE fields. Then inspect OpenTimelineIO's RationalTime API to determine the integration point. Done means OTIO provides dependency- and exception-free conversion between RationalTime and binary SMPTE time codes with the relevant fields and behavior covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.