Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using flow segment timeranges and related spec updates #97

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

philipnbbc
Copy link
Contributor

Details

This PR adds an Application Note that describes the use of the Flow Segment timerange property. The PR also updates the definitions of the Flow Segment timerange and last_duration properties.

Pivotal Story (if relevant)

Story URL: https://www.pivotaltracker.com/story/show/188581560

Related PRs

Where appropriate. Indicate order to be merged.

Submitter PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • API version has been incremented if necessary
  • ADR status has been updated, and ADR implementation has been recorded
  • Documentation updated (README, etc.)
  • PR added to Pivotal story (if relevant)
  • Follow-up stories added to Pivotal

Reviewer PR Checks

(tick as appropriate)

  • PR completes task/fixes bug
  • Design makes sense, and fits with our current code base
  • Code is easy to follow
  • PR size is sensible
  • Commit history is sensible and tidy

Info on PRs

The checks above are guidelines. They don't all have to be ticked, but they should all have been considered.

@philipnbbc philipnbbc requested a review from a team as a code owner November 28, 2024 10:14
Define it as a difference between the exclusive end and the last sample
timestamp.
Be specific about when the timerange uses an exclusive (samples have
duration) or inclusive end (samples don't have a duration).
E.g. for 48kHz audio samples with an exclusive timerange end.
@philipnbbc philipnbbc force-pushed the philipn-flow-segment-timeranges branch from 4c18ac9 to 8d88b77 Compare November 28, 2024 10:15
Copy link
Member

@samdbmg samdbmg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice explanation and diagrams

@@ -16,11 +16,11 @@
"$ref": "timestamp.json"
},
"timerange": {
"description": "The timerange from the first sample in the segment to the last, with an inclusive start and inclusive or exclusive end, as described by the [TimeRange](../schemas/timerange#top) type. Note that where temporal re-ordering is used, this refers to the presentation timeline.",
"description": "The timerange for the samples contained in the segment. If samples have a duration then the timerange end is exclusive and covers at least the duration of the last sample. The exclusive timerange end will typically be set to the timestamp of the next sample. If the samples don't have a duration then the timerange end is inclusive. Format is described by the [TimeRange](../schemas/timerange#top) type. Note that where temporal re-ordering is used, the timerange and samples refers to the presentation timeline.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the timerange start still be inclusive, as stipulated originally?

@@ -0,0 +1,144 @@
# Using Flow Segment Timeranges

This application note explains the usage of the Flow Segment `timerange` property, starting with a short primer on Timestamps and Timeranges.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cross link to app note 8 might be useful here, inviting the reader to review the details of the representation there, and the usage here

A sample is a frame of video, a sample of audio or a data item like a subtitle.

A sample Timestamp is an approximation of the time a sample is "active" on the Timeline.
The sample Timestamps may simply represent the order of samples on the Timeline and may not be an accurate representation of the time the sample was captured or presented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Is there a way to make this more practical: because I think in most of our trials we've accepted this inaccuracy as being "close enough"

Suggested change
The sample Timestamps may simply represent the order of samples on the Timeline and may not be an accurate representation of the time the sample was captured or presented.
The sample Timestamps may simply represent the order of samples on the Timeline and may not be an accurate representation of the time the sample was captured or presented.
However in many cases it is sufficient to assume the sample Timestamp accurately represents when the sample should be presented, and that the inherent inaccuracy was reduced to acceptable levels during the capture process.


A Timestamp does not specify the sample duration on the timeline.

### What is a Timerange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: In the mediatimestamp library and in https://github.com/bbc/tams/blob/main/api/schemas/timerange.json#L2 this is styled as "TimeRange" when capitalised (or "timerange" otherwise). Should the same style be used here?

Note that a Flow Segment can have gaps within it and creators of Flow Segments need to decide whether a gap at the end of a Flow Segment need to be included or exposed.

Including the gap in the Flow Segment means extending the `timerange` to the next Flow Segment's first sample Timestamp.
The `last_duration` is set to the difference between the `timerange` end and the last sample Timestamp.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Consider adding an example of why you'd do this

Suggested change
The `last_duration` is set to the difference between the `timerange` end and the last sample Timestamp.
The `last_duration` is set to the difference between the `timerange` end and the last sample Timestamp.
This may, for example, indicate that the gap represents a meaningful gap in the content (instead of content that was lost in transmission).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants