mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.38k stars 2.91k forks source link

Some videos stutters ever since mpv-x86_64-20240820-git-67e087d release #14806

Closed vagabondshrimp closed 1 month ago

vagabondshrimp commented 1 month ago

mpv Information

mpv v0.38.0-747-g0eb5e914 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Sep  6 2024 00:10:54
libplacebo version: v7.349.0 (v7.349.0-9-gefb8934-dirty)
FFmpeg version: N-116878-ga49188297
FFmpeg library versions:
   libavcodec      61.11.100
   libavdevice     61.2.100
   libavfilter     10.2.102
   libavformat     61.5.101
   libavutil       59.35.100
   libswresample   5.2.100
   libswscale      8.2.100

Other Information

- Windows version: 11
- GPU model, driver and version: intel hd graphics 500
- Source of mpv: Shinchiro
- Introduced in version: mpv-x86_64-20240820-git-67e087d

Reproduction Steps

Tried all mpv version after mpv-x86_64-20240819-git-a3baf94 release, with and without config.

Expected Behavior

Video plays normally

Actual Behavior

Video stutters

Log File

mpv-x86_64-20240906-git-0eb5e91 (stutters) log.txt

mpv-x86_64-20240819-git-a3baf94 (doesn't stutter) log.txt

Sample Files

https://github.com/user-attachments/assets/97426261-401c-427b-a76b-edae6dae00c1

I carefully read all instruction and confirm that I did the following:

llyyr commented 1 month ago

Can you provide logs with --no-config?

FWIW

[   3.127][w][cplayer] Invalid video timestamp: 0.291956 -> 0.208540
[   3.127][d][vo/gpu-next/libplacebo] Non monotonically increasing PTS 0.291956 -> 0.208540
[   3.130][d][vo/gpu-next] Render queue underrun.
[   3.159][v][vo/gpu-next] Forcing queue refill, PTS(0.208540 + 0.000000 | 0.000000) < VPTS(0.291956)
[   3.159][d][vo/gpu-next/libplacebo] First frame received with non-zero PTS 0.208540

Though I don't see what could cause this in that regression range.

edit:

There are some ffmpeg hevc refactors in that regression range, can you reproduce with any other codec?

obscenelyvague commented 1 month ago

It is a HEVC specific bug. I think it has something to do with one of the encoding settings, which there are plenty of if you take a look at the sample OP linked.

Encoding settings : cpuid=1111039 / frame-threads=4 / wpp / 
no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / 
input-csp=1 / input-res=1920x800 / interlace=0 / 
total-frames=0 / level-idc=0 / high-tier=1 / uhd-bd=0 / ref=4 
/ no-allow-non-conformance / no-repeat-headers / annexb / 
no-aud / no-hrd / info / hash=0 / no-temporal-layers / 
open-gop / min-keyint=23 / keyint=250 / gop-lookahead=0 / 
bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / 
rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / 
hist-scenecut=0 / radl=0 / no-splice / no-intra-refresh / 
ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / 
tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / 
rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / 
no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / 
strong-intra-smoothing / max-merge=3 / limit-refs=3 / 
limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / 
no-frame-dup / no-hme / weightp / no-weightb / 
no-analyze-src-pics / deblock=0:0 / no-sao / 
no-sao-non-deblock / rd=4 / selective-sao=0 / no-early-skip / 
rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / 
no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / 
psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / 
crqpoffs=0 / rc=abr / bitrate=2000 / qcomp=0.60 / qpstep=4 / 
stats-write=0 / stats-read=2 / cplxblur=20.0 / qblur=0.5 / 
ipratio=1.40 / pbratio=1.30 / aq-mode=3 / aq-strength=1.00 / 
cutree / zone-count=0 / no-strict-cbr / qg-size=32 / 
no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / 
overscan=0 / videoformat=5 / range=0 / colorprim=2 / 
transfer=2 / colormatrix=2 / chromaloc=0 / display-window=0 / 
cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / 
vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / 
no-opt-ref-list-length-pps / no-multi-pass-opt-rps / 
scenecut-bias=0.05 / hist-threshold=0.01 / no-opt-cu-delta-qp 
/ no-aq-motion / no-hdr10 / no-hdr10-opt / no-dhdr10-opt / 
no-idr-recovery-sei / analysis-reuse-level=0 / 
analysis-save-reuse-level=0 / analysis-load-reuse-level=0 / 
scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=1 
/ refine-ctu-distortion=0 / no-limit-sao / ctu-info=0 / 
no-lowpass-dct / refine-analysis-type=0 / copy-pic=1 / 
max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei / 
no-hevc-aq / no-svt / no-field / qp-adaptation-range=1.00 / 
no-scenecut-aware-qpconformance-window-offsets / right=0 / 
bottom=0
llyyr commented 1 month ago

I can reproduce the stutter with ffplay from master, I'll bisect what caused it

llyyr commented 1 month ago

Caused by https://github.com/FFmpeg/FFmpeg/commit/2fdecbb239714b6203e37067fda2521f80e19d47

kungfubeaner commented 1 month ago

I have this exact same issue since the very same version. I was going to post but I found this before I posted luckily. I'm still running the one for windows v3 version from 2004-08-17 for that reason. I have a Terminator 2 clip that makes it easy to reproduce. If i hit forward arrow on keyboard to skip ahead it will stutter non stop. Today's release still has the issue.

llyyr commented 1 month ago

Please report to https://trac.ffmpeg.org. I reported on IRC but it doesn't seem trivial to diagnose why it happens so it might get forgotten.

llyyr commented 1 month ago

Fixed upstream

kasper93 commented 1 month ago

Fixed by: https://github.com/FFmpeg/FFmpeg/commit/b53800691c121150e75dfa0ba76899d3692af57f

hooke007 commented 2 weeks ago

I noticed this commit. I doubt it wasn't fixed clearly. I can still get the 'stutter' here. Ref: https://github.com/shinchiro/mpv-winbuild-cmake/issues/705

llyyr commented 2 weeks ago

Are you sure it's the same issue? Would be helpful if you could bisect since the issue should be reproducible with ffplay as well.

hooke007 commented 2 weeks ago

Does ffplay have the option like --hwdec=yes --hr-seek-framedrop=no ?

llyyr commented 2 weeks ago

Does ffplay have the option like --hwdec=yes --hr-seek-framedrop=no ?

The issue linked in this ticket only happens on certain (broken) files that ffmpeg manages to playback correctly with PTS guessing. If your issue happens with all hevc files, or only when seeking, or only with hwdec, then it's a different issue.

obscenelyvague commented 1 week ago

It's not the same issue but probably another regression caused by the refactor. I can share sample. https://files.catbox.moe/1chkj1.mkv