seek slow
Hello, when I am testing the seek to drag the video, it takes a very long time for the gop long video file, but we compare mx player, they seek the same video file, fast and ready, does exoplayer have time to do it? Optimization, or any ideas can be shared? Thank you
Does the information in #6794 help?
I noticed you mentioned 'gop long' -- do you mean the groups of pictures (GOPs) are long, so keyframes are sparse? If so I'd recommend producing streams with denser keyframes if you want seeking to be responsive (though of course that doesn't explain different behavior from ExoPlayer and MXPlayer on the same stream).
Hello,'gop long' means'the groups of pictures (GOPs) are long'. I read the seek logic of exoplayer. After seek, I find the previous key frame timestamp and send it to the decoding buffer. When decoding, If the timestamp of the current buffer is less than the timestamp of the current position, BUFFER_FLAG_DECODE_ONLY will be set, and the decoding will proceed normally, but the video frame will not be rendered; this will cause many frames to be discarded for the gop long video, which will cause delay. At this point, what I think is that if you want to seek correct and fast seek, in the decoding module, you should quickly locate the frame closest to the current position timestamp, find the relevant frame and decode it directly, so that exoplayer can be optimized? ? Thank you
When decoding, If the timestamp of the current buffer is less than the timestamp of the current position, BUFFER_FLAG_DECODE_ONLY will be set, and the decoding will proceed normally, but the video frame will not be rendered; this will cause many frames to be discarded for the gop long video, which will cause delay.
Do you want to show those frames? If so, I think you can just set the seek parameters like player.setSeekParameters(SeekParameters.PREVIOUS_SYNC); to snap the seek point to the preceding keyframe.
At this point, what I think is that if you want to seek correct and fast seek, in the decoding module, you should quickly locate the frame closest to the current position timestamp, find the relevant frame and decode it directly, so that exoplayer can be optimized?
Assuming your stream correctly marks which frames are keyframes, it's not in general possible to decode any given frame "directly". To decode a given frame, the decoder needs to be handle all input from the preceding keyframe, as the frame is allowed to reference the result of decoding earlier frames (up to the keyframe).
Hello, I found through the log that whenever I seek to a certain position, I search for the previous key frame in the seek index, but the timestamp of the parsed frame is not the closest, so when I find the time after the seek The poke is still smaller than the current position, I will directly look for the next key frame in the buffer, and through the test, the seek rate has doubled.