Skip to content
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

only use HLS for live tv - otherwise use progressive mkv #1440

Closed

Conversation

mueslimak3r
Copy link
Member

@mueslimak3r mueslimak3r commented Feb 15, 2022

Changes

  • revert to using progressive mkv for everything but live tv which will still use HLS
  • added a condition to getBufferedPosition() that excludes live-tv. The logic for getting the current position when playing live tv is kinda broken, especially if the player is paused and then resumed.

Issues

  • using mkv again should resolve 0.13beta1 track transcoding bug #1410 though I'm not sure about live-tv contexts

  • after seeking using HLS, the video would be slightly early but the timestamp wouldn't reflect it.
    This caused:

    • subtitles to be out of sync
    • the last few seconds of a video looping

    According to ffmpeg docs, the flag -noaccurate_seek, which jellyfin uses, supplies a stream starting at the key-frame prior to the requested timestamp. This is incompatible with exoplayer's frame-accurate seeking.
    The ffmpeg docs (https://trac.ffmpeg.org/wiki/Seeking):

    -ss is now also "frame-accurate" even when used as an input option. Previous behavior (seeking only to the nearest
    preceding keyframe, even if not precisely accurate) can be restored with the -noaccurate_seek option

    To resolve this and use HLS in contexts that allow seeking, the version of exoplayer we use will need to support SeekParameters for HLS. As far as I can tell, the flag we'd use is SeekParameters.PREVIOUS_SYNC
    The relevant issue is here:
    Support key-frame accurate seeking in HLS google/ExoPlayer#2882
    And here is the merged PR that should allow this once the next exoplayer release comes out:
    Implements SeekParameters.*_SYNC variants for HLS google/ExoPlayer#9536

Notes

  • using HLS has made the player far more stable. If there's a way to synchronize the subtitles despite the player being unaware of the desync then that would be much better than abandoning HLS.

@mueslimak3r mueslimak3r marked this pull request as draft February 15, 2022 09:45
@mueslimak3r
Copy link
Member Author

I'm leaving this as a draft pending this server issue since it seems to only happen with mkv, and while testing this PR I encountered it a bunch:
jellyfin/jellyfin#6957

I've been digging around for a client-side cause of this but haven't found anything

@mueslimak3r mueslimak3r deleted the revert-hls-for-non-livetv branch February 26, 2022 09:02
@mueslimak3r mueslimak3r restored the revert-hls-for-non-livetv branch February 26, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.13beta1 track transcoding bug
1 participant