-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Allow ClippingMediaSource
in a ConcatenatingMediaSource2
by adjusting start timestamps
#11226
Comments
From what I have looked at so far this seems to be more of an issue with how the With that in mind could I create a new clipping media source class (or add a flag to the current one) that ensures the sample stream is clipped, but then has a media period that treats the media as if it is just the clipped subsequence e.g. it has an offset of 0, but the sample stream is in fact reading from the start of whichever subsequence we specify? |
Sounds like you explained everything yourself already :) The media model of ExoPlayer uses "windows" for the user-facing entities and "periods" for the more technical individual stream instances. A The ideal way to fix this is to make the media model more flexible and allow non-zero offsets for all periods. However, this is tricky to achieve as lots of code in ExoPlayer and many existing apps has been built under the current assumptions. We considered adding a workaround for the specific problem you mention ( |
ClippingMediaSource
to a ConcatenatingMediaSource2
?ClippingMediaSource
in a ConcatenatingMediaSource2
by adjusting start timestamps
Awesome! Thanks for the detailed explanation @tonihei 🙌 For now I'll try setup a custom |
Just checking I've got this correct @tonihei - by adjusting the timestamps that would mean setting up a custom media source, media period and finally a sample stream in which I'd create an offset for the time the samples should be read at? I've tried setting this up but haven't had much success with it yet and hoping you might be able to easily point me in the right general direction 🙏 Thanks in advance! |
It may be complicated to get this right. There is already a |
Thanks @tonihei - appreciate your time and the pointers here! 🙌 |
@thomas-coldwell Did you manage to accomplish this? If so, could you share some sample code? |
Had a look into this issue this week. We'll reuse the |
This makes it reusable for other MediaSource/Periods in the same package. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563687935
This makes it reusable for other MediaSource/Periods in the same package. Issue: #11226 PiperOrigin-RevId: 563687935
The class currently disallows offsets of periods in their windows except for the very first window. This is not necessary because we can use TimeOffsetMediaPeriod to eliminate the offset if needed. This makes the class more useful for many use cases, in particular for using it with ClippingMediaSource. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563702120
The class currently disallows offsets of periods in their windows except for the very first window. This is not necessary because we can use TimeOffsetMediaPeriod to eliminate the offset if needed. This makes the class more useful for many use cases, in particular for using it with ClippingMediaSource. Issue: #11226 PiperOrigin-RevId: 563702120
This makes it reusable for other MediaSource/Periods in the same package. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563687935
The class currently disallows offsets of periods in their windows except for the very first window. This is not necessary because we can use TimeOffsetMediaPeriod to eliminate the offset if needed. This makes the class more useful for many use cases, in particular for using it with ClippingMediaSource. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563702120
@tonihei Do you have any info when this is released in an updated version of the library? |
This will be part of 1.2.0, probably beginning of November roughly. (But there will be alpha/beta/rc versions before that) |
This makes it reusable for other MediaSource/Periods in the same package. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563687935
The class currently disallows offsets of periods in their windows except for the very first window. This is not necessary because we can use TimeOffsetMediaPeriod to eliminate the offset if needed. This makes the class more useful for many use cases, in particular for using it with ClippingMediaSource. Issue: google/ExoPlayer#11226 PiperOrigin-RevId: 563702120
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:
However, I get the following error
"Can't concatenate windows. A window has a non-zero offset in a period."
from this line in theConcatenatingMediaSource2
implementation. I also noticed at the top of the class it specifically says it excludesClippingMediaSource
'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! 🙌
The text was updated successfully, but these errors were encountered: