You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing the current dev-v2 branch of ExoPlayer and specifically the ClippingMediaSource functionality. I see in #1988 that @andrewlewis wrote:
To avoid buffering you therefore need to ensure that the clipping start point corresponds to a synchronization sample/key-frame.
Is there a utility function somewhere that, given a time in the video, calculates the nearest synchronization sample/key-frame? I would prefer to have seamless transitions than frame accurate start times.
The text was updated successfully, but these errors were encountered:
There is no utility function in ExoPlayer to do this at the moment I'm afraid. It might be possible to provide an alternative mode in ClippingMediaSource that will snap to the start point to a keyframe. That would likely be the most efficient way to do this, as then it won't be necessary to have a separate loading step to find the keyframe. The duration of the period would only be set in the Timeline after the keyframe position becomes known. (We probably won't get around to doing this for a while unless it's needed for something else.)
If you know what media will be played in advance you could construct a ClippingMediaSource with the right start time. There are lots of ways to find keyframes; I use a command like ffprobe stream.mp4 -show_packets -print_format compact | grep -Po 'pts_time=\K([0-9.]+)(?=\|.*flags=K_$)' | head -c -1 | tr '\n' ','.
ojw28
changed the title
dev-v2 ClippingMediaSource -- Ensure keyframe
ClippingMediaSource: Provide easy way to set clipping start point to a keyframe
Jan 23, 2019
I was testing the current dev-v2 branch of ExoPlayer and specifically the ClippingMediaSource functionality. I see in #1988 that @andrewlewis wrote:
Is there a utility function somewhere that, given a time in the video, calculates the nearest synchronization sample/key-frame? I would prefer to have seamless transitions than frame accurate start times.
The text was updated successfully, but these errors were encountered: