Skip to content

Corrupt frame when seeking HEVC encoded with x265 2.8 or later #6218

@bodayw

Description

@bodayw

mpv version and platform

mpv v0.29.1 on Windows/macOS/Linux

Reproduction steps

Open any video encoded with x265 2.8 or later in mpv and click on the progress bar to seek.

Expected behavior

It should show the target frame just fine.

Actual behavior

Almost on every seek, mpv will show a corrupt frame, similar to the screenshot in #3440.

If mpv is running in command line mode, it will also print this error message:

[ffmpeg/video] hevc: Could not find ref with POC 0

So it seems that mpv failed to find the last I-frame, resulting a "corrupt" partially encoded frame being shown.

Some observations:

  • The issue is not platform-dependent. We could reproduce with latest mpv builds on Windows/macOS/Linux, with x265 2.8 and 2.9 compiled and files encoded on Windows/Linux;
  • The issue only happens with HEVC files encoded with x265 2.8 or later, while everything seems fine with HEVC encoded with at least x265 2.5, 2.6 and 2.7;
  • The issue happens no matter --hr-seek is set to absolute (default), yes, or no;
  • Tried setting --hr-seek-demuxer-offset=5 and it did help to reduce the chance of showing a corrupt frame, but couldn't eliminate it completely;
  • We've tried MPC-HC/MPC-BE/PotPlayer/VLC/ffplay and couldn't reproduce the issue;
  • In all tests software decoding is used, so not really sure if this is related to HEVC hardware decoder breaks after seeking in macOS 10.14 (Mojave) #6152 and such.

Log file

https://0x0.st/sEyI.txt

(See line 2393-2399 when seeking occurs)

Sample files

https://0x0.st/sEyJ.mkv
https://0x0.st/sEyy.mkv

(The first file is encoded with x265 2.8, second one is x265 2.7 which doesn't have the problem)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions