-
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
Use SeekParameters in ClippingMediaSource to snap clipping positions to keyframes #5501
Comments
However, we do already have a mechanism to snap seek positions to the closest, previous or next keyframe (see Final note: If you know the exact position of the keyframe in the video, you can set this position as clipping point and set the |
Thanks for reply, can I use snap seek to retrieve information about frames
in time window or its implemented internally?
…On Tue, Feb 12, 2019, 17:51 tonihei ***@***.***> wrote:
ClippingMediaSource currently applies the start and end position as it
is. If a source doesn't start with a keyframe, we can't play transitions
seamlessly. The reason is that we would need to decode two streams in
parallel (the end of the first stream and the start of the second stream
from the previous keyframe to the actual start position) to allow such a
transition.
However, we do already have a mechanism to snap seek positions to the
closest, previous or next keyframe (see SeekParameters). We can
potentially reuse this mechanism to allow ClippingMediaSource to snap its
clipping positions once it has the required information. I'll mark this
issue as an enhancement to track that.
Final note: If you know the exact position of the keyframe in the video,
you can set this position as clipping point and set the
enableInitialDiscontinuity parameter of ClippingMediaSource to false to
get seamless transitions with the current video.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5501 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAvO2fRLV9fvExbH1augPIZbEy7wpKyLks5vMvEbgaJpZM4a3JY1>
.
|
Interesting question. You could try to pause the player I haven't tested it, but it may work. Note that the keyframe may not be at a millisecond boundary and the returned value could therefore be slightly wrong. |
To clarify, is the idea here that we'd re-use As an extra question, can #2347 be duplicated onto this issue? This one seems to be tracking a superset of the functionality being requested on that issue. |
Clarification sounds correct, also close the other issue. |
Hello,
I have problem with ExoPlayer - ClippedMediaSource.
In application I have a source video.
From this video, I'd like to play content from start to end - in miliseconds, in sample app its:
start: 1140ms end 3140ms
I'd like to concat it with looped part of a video:
start: 3140ms end 34050ms
Looks like perfect scenario for ClippingMediaSource, LoopingMediaSource and ConcatenatingMediaSource.
I created sample application with code used for it:
https://github.com/bkraszewski/ExoPlayerSample/tree/master
Also you can take a look at video captured:
https://www.youtube.com/watch?v=SOBl6biAUgI
Hoverer I noticed transition between start part and looped part is not smooth, there is a visual glitch when switching part. In docs I found that I need to make sure time match keyframes - but can I make it dynamically?
There is a way to find closest frame to exact moment of video ending so I can adjust clipping time?
This video is just a sample, but our IOS team is using similar logic to stitch videos with same start/end params and its smooth.
Testing ENV:
ExoPlayer 2.9.5 (previously tested with 2.9.4, same result)
Android Studio 3.3
Phone: Samsung S8
The text was updated successfully, but these errors were encountered: