mpv-player / mpv-player/mpv

Massive framedrops in mpv 0.36.0 compiled with rpi-ffmpeg 6.0 with 4k 60 Hz HEVC HDR 10bit videofiles

Open
#13,055 41 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

os:linux
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Important Information

Provide following Information:

  • mpv version: 0.36.0
  • Linux Distribution and Version: Debian GNU/Linux 12 (bookworm) in a form of Raspberry OS 64bit
  • Source of the mpv binary: compiled from https://github.com/mpv-player/mpv
  • GPU driver and version: Raspberry Pi 4 V3D driver
Sample files

Get the test video file first:
$ yt-dlp -f dash-google_mediacdn-video-f4765daf https://vimeo.com/712764913
$ du -hs Samsung-and-RedBull-See-the-Unexpected-HDR-UHD-4K-(www.demolandia.net\).ts\ [712764913].mp4
350M Samsung-and-RedBull-See-the-Unexpected-HDR-UHD-4K-(www.demolandia.net).ts [712764913].mp4

Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 3 min 17 s
Bit rate                                 : 14.6 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 59.940 (60000/1001) FPS
Reproduction steps

I use specific ffmpeg libs-> /usr/lib/rpi-ffmpeg-6/lib, libplacebo lives in /usr/local/lib/aarch64-linux-gnu.

Playing the HEVC videofile 4k 60 Hz so

#!/bin/bash

LD_LIBRARY_PATH=/usr/lib/rpi-ffmpeg-6/lib:/usr/local/lib/aarch64-linux-gnu mpv --no-config --vo=gpu --gpu-context=drm --hwdec=drm \
                                        --drm-draw-plane=overlay --drm-drmprime-video-plane=primary --drm-draw-surface-size=1920x1080 \
                                        Samsung-and-RedBull-See-the-Unexpected-HDR-UHD-4K-\(www.demolandia.net\).ts\ \[712764913\].mp4 

Output:

AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 drm_prime[rpi4_10]
AV: 00:00:02 / 00:03:17 (1%) A-V:  0.032 Dropped: 128

There are framedrops even massive framedrops in several seconds of playing.

And HEVC 1080p in action. 0 framedrops:

$ LD_LIBRARY_PATH=/usr/lib/rpi-ffmpeg-6/lib:/usr/local/lib/aarch64-linux-gnu mpv --no-config --vo=gpu --gpu-context=drm --hwdec=drm                                         --drm-draw-plane=overlay --drm-drmprime-video-plane=primary --drm-draw-surface-size=1920x1080                                         Ahsoka.S01E01.1080p.HEVC.x265-MeGusta\[eztv.re\].mkv
AO: [pulse] 48000Hz 5.1(side) 6ch float
VO: [gpu] 1920x1080 drm_prime[rpi4_10]
AV: 00:00:14 / 00:54:43 (0%) A-V:  0.000

I ask because these are played smoothly with no dramedrops but without sound as well, also vlc plays also without framedrops and A/V desynchronization.

And LibreElec supports for playing HEVC 4k 60 Hz somehow, i tried almost the same config but no luck.

$ LD_LIBRARY_PATH=/usr/lib/rpi-ffmpeg-6/lib /usr/lib/rpi-ffmpeg-6/bin/ffmpeg  -no_cvt_hw -hwaccel drm -vcodec hevc -i Samsung-and-RedBull-See-the-Unexpected-HDR-UHD-4K-\(www.demolandia.net\).ts -f vout_drm /dev/null
$ LD_LIBRARY_PATH=/usr/lib/rpi-ffmpeg-6/lib ./hello_drmprime Samsung-and-RedBull-See-the-Unexpected-HDR-UHD-4K-\(www.demolandia.net\).ts

No connector ID specified.  Choosing default from list:
Connector 32 (crtc 96): type 11, 1920x1080 (chosen)
Connector 42 (crtc 0): type 11, 0x0
[hevc @ 0x5577979a40] Hwaccel V4L2 HEVC stateless V4; devices: /dev/media1,/dev/video19; buffers: src DMABuf, dst DMABuf; swfmt=rpi4_10
Expected behavior

Video plays smoothly

Actual behavior

Massive framedrops

Why not mpv 0.37?

Because these lines are in mpv log

[hwupload] Unable to find a compatible upload format for rpi4_10
[autoconvert] Failed to create HW uploader for format rpi4_10

mpv 0.37 and mpv-git still have some issues when working with rpi-ffmpeg

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the 4K 60 Hz HEVC HDR case with the provided mpv command and compare it with the working 1080p case. Review the DRM hardware-decoding path around the rpi4_10 format and the reported hwupload/autoconvert messages, then verify the result by confirming smooth playback without the reported frame drops.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, raspberry-pi
Domain
audio-video-rtc, cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.