2

I have a problem with video encoding for HLS stream.

I've found that most video players not support frame accurate seeking or pausing at specific frame and they can't really give us the accurate current time of the playback. I don't really understand that, because doesn't seem too hard to figure out the current time. (AVPlayer and ExoPlayer have same problem)

Why is it so hard to pause or seek to specific frame in a HLS (not live) stream? Why can't the players give an accurate time/position information about the playback? Why is it so hard?

I also found that keyframes/GOP size maybe related to this problem, because video players will seek to the closest keyframe.

So my question is that, can I somehow improve the seeking and current time information with a specific ffmpeg transcode settings?

3
  • 1
    If the issue is related to key frames, then transcoding to a codec that has only key frames (such as MJPEG) will probably do, but at the expanse of a huge file size (or poor quality). That said it seems to me that VLC for instance has a frame by frame advance/back capability (don't know if it displays the exact timing beyond 1 second accuracy, though)
    – PierU
    Sep 7, 2022 at 11:09
  • I tried encoding with force 4 keyframe/seconds. Now the seeking and current time works well. I understand that why it could fix the seeking problem, but i can't imagine that how related the current time to the keyframes?
    – D.Bence
    Sep 7, 2022 at 15:31
  • 1
    This is probably player dependant. When seeking along a video, some players may chose to decode only the keyframes (with their associated times) because this is faster.
    – PierU
    Sep 7, 2022 at 16:15

0

You must log in to answer this question.

Browse other questions tagged .