Skip to content

Setting SEEK and LENGTH on movie and audio#121

Draft
mellbergsimon wants to merge 7 commits intosvt:mainfrom
mellbergsimon:SeekLength
Draft

Setting SEEK and LENGTH on movie and audio#121
mellbergsimon wants to merge 7 commits intosvt:mainfrom
mellbergsimon:SeekLength

Conversation

@mellbergsimon
Copy link
Contributor

@mellbergsimon mellbergsimon commented Mar 21, 2026

Seek and Length

Description

This PR attempts to add functionality for setting the seek and length options for caspar. This enables the user to quickly select where to start and end the video or audio.

Changes

I needed to add 2 more variables to the item.data field. Specifically:

data: {
  name: item.name,
  caspar: {
  server: item?._filter?.serverId,
  target: item.name,
  ...(DEFAULT_VALUES[item.type] || {})
  },
  duration: asset.calculateDurationMs(item),
+ medialength: Number.parseInt(item?.duration),
+ framerate: asset.frameRateFractionToDecimal(item?.framerate)          
}

Not the most beautiful implementation and I appreciate tips how to improve this.

The Seek field itself is expected by Caspar to be in frames:
new seek field
This is not the most intuitive solution and I know we discussed there being some sort of drop down selector for these in the future.

General usage:

3 points of selection. Left (seek), right (length) and the entire bar. Small rounding error can occur when dragging bar from start to end.

general.usage.mov

I tried to limit the amount of userefs and divide the component into smaller manageable chunks. But I am still a little bit unsure about the SUIT naming convention. I really tried my best with the naming scheme in this, but I am sure I have made mistakes.

Fixes #68

New issue?

I tried to implement that if the duration is changed, the length setting should follow but after changing the duration field it seems to lock until the item in the rundown is pressed once again.

duration.locks.after.editing.mov

My though process was that we could clamp the duration so that it would not be possible to write a larger value than what the media actually has. But the duration field could also used in making counters with a defined time so I am not sure what the best solution going forward would be.

White theme

The colors i selected does not look good on white theme. I would like some assistance selecting a good color palate that works on all themes.

white_theme

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I have tested it against my own Linux caspar server filled with different testing media.

Test Configuration:

  • Firmware version: Bridge 1.0.0-beta.10
  • Hardware: Bridge running on Macbook pro. CasparCG 2.5 on ubuntu 24
  • Toolchain: n/a
  • SDK: n/a

Checklist:

  • I confirm that I wrote and/or have the right to submit the contents of my PR, by agreeing to the Developer Certificate of Origin (see https://github.com/svt/open-source-project-template/blob/master/docs/CONTRIBUTING.adoc[docs/CONTRIBUTING]).
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)

Simon Mellberg added 6 commits March 20, 2026 23:24
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
…et.cjs

Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
@mellbergsimon mellbergsimon marked this pull request as draft March 21, 2026 08:24
Signed-off-by: Simon Mellberg <mellbergsimon@example.com>
@axelboberg
Copy link
Member

This is great Simon, well done!

The next release of Bridge will include a timeline and I'd very much like to include this feature with that. However, I think we should think twice about introducing the media length property, as that would be a second parameter that would need to be updated by any plugin wanting to change or create media items (and this is such a basic function that I think it should be generic for almost anything).

One way I've though about it is to add the following properties:
inPoint – houses the offset from the start of the clip in ms when playback should start, if not set this will be 0
outPoint – houses the offset from the start of the clip in ms when playback should end, if not set this will equal duration
duration – stays unchanged, allowing for backwards compatibility

Then there would be a new API function for calculating the effective playback duration of any item in the rundown. Logically resolving to the duration if no in or out points are set. What do you think about that approach?

Then of course the challenge still persists with connecting a frame rate to each Caspar media file (bridge.caspar.playable). Let's say you're changing media files by just writing the name. A frame rate property wouldn't be updated automatically. Could one option be to set it as a property for the server that would act as default?

Here's a sneak peek of the new timeline, but I think your UI should still be in the inspector.
Screenshot 2026-03-22 at 22 17 31

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.

SEEK and LENGTH as a IN - OUT bar to set start and end points for a media item (MOVIE and AUDIO)

2 participants