这是indexloc提供的服务,不要输入任何密码
Skip to content

Allow ClippingMediaSource in a ConcatenatingMediaSource2 by adjusting start timestamps #11226

@thomas-coldwell

Description

@thomas-coldwell

Hi I am trying to achieve the following media composition with two videos - a first video with no clipping applied that is then concatenated with a second clip that has the first 1000ms of playback clipped. The mode for this looks something like:

val firstVideo = createMediaSourceFromUrl(firstVideoSource)
val secondVideo = createMediaSourceFromUrl(secondVideoSource, clipStartMs: 1000)

val finalMediaSource = ConcatenatingMediaSource2.Builder()
  .add(firstVideo)
  .add(secondVideo)
  .build()

However, I get the following error "Can't concatenate windows. A window has a non-zero offset in a period." from this line in the ConcatenatingMediaSource2 implementation. I also noticed at the top of the class it specifically says it excludes ClippingMediaSource's from being concat.

I'm trying to understand the way this class works a bit better and why the non-zero offset of the clipped media source prevents it from being concatenated and was wondering if anyone might be able to share some insights on this or if there is a way to achieve this (or the steps I might take to make my own Concat class that would support this)?

Thank you in advance! 🙌

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions