Mpv-0.36 how to setup

I merged the ffmpeg-rpi (v4) PKGBUILD with the ffmpeg PKGBUILD using that branch and it did do h264 v4l2m2m HW decoding with mpv and firefox but mpv would not do HEVC HW decoding. There were some features disabled that I believe HEVC needs in his 6.0 dev branch. It says options not available. So I am guessing he is in the early stages with that branch. Options disabled:

  # for hw decoding
    --disable-mmal    #Most likely for 32bit
    --enable-neon     #Most likely not needed
    --enable-v4l2-request
    --enable-libudev
    --enable-epoxy
    --enable-sand

May not be a total loss though since ffmpeg-rpi and ffmpeg can be installed at the same time and have mpv and vlc use ffmpeg-rpi.

Did you happen to test if firefox and mpv was using v4l2m2m HW decoding.

Firefox

[h264_v4l2m2m @ 0xffff84c88800] --- output pre VIDIOC_QBUF: index 0, ts=0.000033 count=0
[h264_v4l2m2m @ 0xffff84c88800] --- output VIDIOC_QBUF: index 0, ts=0.000033 count=1

No video if i don’t use this fmpeg (and i had epoxy and libudev autodetected) when i build.

For mpv

 v4l2m2m (h263_v4l2m2m-v4l2m2m)
  v4l2m2m (h264_v4l2m2m-v4l2m2m)
  v4l2m2m (hevc_v4l2m2m-v4l2m2m)
  v4l2m2m (mpeg4_v4l2m2m-v4l2m2m)
  v4l2m2m (mpeg1_v4l2m2m-v4l2m2m)
  v4l2m2m (mpeg2_v4l2m2m-v4l2m2m)
  v4l2m2m (vc1_v4l2m2m-v4l2m2m)
  v4l2m2m (vp8_v4l2m2m-v4l2m2m)
  v4l2m2m (vp9_v4l2m2m-v4l2m2m)
  qsv-copy (h264_qsv-qsv-copy)
  qsv-copy (hevc_qsv-qsv-copy)
  qsv-copy (mpeg2_qsv-qsv-copy)
  qsv-copy (vc1_qsv-qsv-copy)
  qsv-copy (av1_qsv-qsv-copy)
  qsv-copy (mjpeg_qsv-qsv-copy)
  qsv-copy (vp8_qsv-qsv-copy)
  qsv-copy (vp9_qsv-qsv-copy)
  v4l2m2m-copy (h263_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (h264_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (hevc_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (mpeg4_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (mpeg1_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (mpeg2_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (vc1_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (vp8_v4l2m2m-v4l2m2m-copy)
  v4l2m2m-copy (vp9_v4l2m2m-v4l2m2m-copy)

Tested in a terminal and with key ‘i’ when playing

Tested with yt-dlp

mpv --hwdec=auto --ytdl-format="(bestvideo[vcodec^=avc1])+(bestaudio/best)"

I looked at your PKGBUILD and mine and hardly any diff. I belive the problem was I pulled in the zip file and you cloned the repo. Some times the .zip files are not complete. I am compiling yours in a few.

In a TTY i have

[vo/gpu/drm] : Failed to acquire DRM master : permission denied

Testing hwdec=drm for hevc

try hwdec=auto

@tartanpion @Rip2 @JFL I have tested @JFL PKGBUILD and I am happy to report that firefox and mpv works using v4l2m2m using ffmpeg6. I did some other testing with a few programs that use ffmpeg6 and so far no problems. I also can report that mpv in the repo can use HW decoding with h264 and h265. I also tested a really stout hevc stream with these specs:

Video
ID                                       : 1
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                                 : 2 min 7 s
Bit rate                                 : 75.6 Mb/s
Maximum bit rate                         : 123 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
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits

Terminal output:

[ray@jellyfin Downloads]$ mpv HDR\ HEVC\ 10-bit\ BT.2020\ 59.940fps\ Camp\ by\ Sony.mp4 
 (+) Video --vid=1 (*) (hevc 3840x2160 59.940fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
Using hardware decoding (drm).
Invalid HDR peak in stream: 0.002463
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 3840x2160 drm_prime[rpi4_10]
AV: 00:00:01 / 00:02:07 (1%) A-V:  0.486 Dropped: 46

htop:

htop-hdr

I will upload my package after I cook and eat supper. Many thanks to @Rip2 and @tartanpion for their input today.

what is your trick for hevc (with hwdec=auto (drm)) ?

Using hardware decoding (drm).
[hwupload] no support for this hw format
[hwupload] hardware format not supported
[autoconvert] Failed to create HW uploader for format rpi4_10
[autoconvert] HW-downloading from drm_prime
AO: [pipewire] 48000Hz 5.1(side) 6ch floatp
VO: [gpu] 3840x1584 yuv420p10
AV: 00:00:06 / 02:06:29 (0%) A-V:  0.489 Dropped: 93

I have

[autoconvert] Failed to create HW uploader for format rpi4_10
VO: [gpu] 3840x1584 yuv420p10

and you

VO: [gpu] 3840x2160 drm_prime[rpi4_10]

just plain mpv --hwdec=auto filename. Not sure why you are getting that but it is not using HW decode but using SW. I will upload my build after I eat.

Added:

I do have disable_fw_kms_setup=1 in /boot/config. You have to reboot when you make the change.

@Darksky, grab that source and use my own PKGBUILD, can play HEVC.

mpv movie/Ahsoka.S01E01.1080p.HEVC.x265-MeGusta\[eztv.re\].mkv 
 (+) Video --vid=1 (*) (hevc 1920x1080 24.000fps)
 (+) Audio --aid=1 --alang=eng (*) (eac3 6ch 48000Hz)
     Subs  --sid=1 --slang=eng (*) 'English [SDH]' (ass)
 (+) Subs  --sid=2 'Ahsoka.S01E01.1080p.HEVC.x265-MeGusta[eztv.re].srt' (subrip) (external)
Cannot load libcuda.so.1
Using hardware decoding (drm).
AO: [pipewire] 48000Hz 5.1(side) 6ch floatp
VO: [gpu] 1920x1080 drm_prime[rpi4_10]
AV: 00:01:02 / 00:54:43 (2%) A-V:  0.000e or paste code here

We are using that source and it is doing good.

Here is my rpi-ffmpeg (v6) package I built based on @tartanpion PKGBUILD. It takes care of the issue with several other programs depending on ffmpeg6. It runs with mpv --hwdec=auto movie-filename. I do not know if it makes a diff at this tme but I have disable_fw_kms_setup=1 set in config.txt. It has to be that way with vlc doing HW.

See post #99 for updated fies.

svt-avi vmaf depends error?

Hard to find what needs to installed with the info you gave.

Added:

2 guesses:

libavif
avisynthplus

@Darksky,

Thanks. Need to remove the earlier ffmpeg-rpi-4.4, mpv-1:0.36.0-3 and ffmpeg-2:6.0-8 (from Manjaro-Arm Repo) that I have installed earlier on Manjaro-Arm-Gnome?

svt-av1 & vmaf both not in ARM’s repos, wonder you guys how to BUILD and install?

@JFL @Rip2

Here is all of the rebuilt files since some libs were updated today on the unstable branch. You miht want to update on the unstable branch as I do not know if it will make any diff or not. I also included all of the PKGBUILD’s. The packages are in the root of the directory I provided. Install them with:

sudo pacman -U *.zst

https://drive.google.com/file/d/11eppAwitnmOh90f2L82NnHTSsoIsN8YO/view?usp=sharing

so, where is 1st build came from without depends error? :rofl:

Not sure what you are talking about. I never released my first build here with ffmpeg6. I wound up using @tartanpion PKGBUILD but changed it up slightly.

@Darksky,

Download your latest rpi-ffmpeg-files.tar and unpack with:

   jfl@jfl-gtkpro  /run/media/jfl/Elements/GT_KING_PRO/Downloads/rpi-ffmpeg-files_Darksky_20230828  cd /home/jfl/Downloads/rpi-ffmpeg-files_20230828/
 jfl@jfl-gtkpro  /Downloads/rpi-ffmpeg-files_20230828  tar -xvf '/home/jfl/Downloads/rpi-ffmpeg-files_20230828/rpi-ffmpeg-files.tar' 
rpi-ffmpeg-files/ffmpeg-rpi/add-av_stream_get_first_dts-for-chromium.patch
rpi-ffmpeg-files/ffmpeg-rpi/PKGBUILD
rpi-ffmpeg-files/vmaf/PKGBUILD
rpi-ffmpeg-files/svt-av1/PKGBUILD
rpi-ffmpeg-files/rpi-ffmpeg-6.0.r110069.gd2aa73557f-1-aarch64.pkg.tar.zst
rpi-ffmpeg-files/svt-av1-1.7.0-1-aarch64.pkg.tar.zst
rpi-ffmpeg-files/vmaf-2.3.1-1-aarch64.pkg.tar.zst
rpi-ffmpeg-files/ffmpeg-rpi/
rpi-ffmpeg-files/vmaf/
rpi-ffmpeg-files/svt-av1/
rpi-ffmpeg-files/
 jfl@jfl-gtkpro  /Downloads/rpi-ffmpeg-files_20230828 

Install the packages:

 jfl@jfl-gtkpro  /Downloads/rpi-ffmpeg-files_20230828  cd /home/jfl/Downloads/rpi-ffmpeg-files_20230828/rpi-ffmpeg-files/
 jfl@jfl-gtkpro  /Downloads/rpi-ffmpeg-files_20230828/rpi-ffmpeg-files  sudo pacman -U *.zst
[sudo] password for jfl: 
loading packages...
resolving dependencies...
looking for conflicting packages...
:: rpi-ffmpeg and ffmpeg are in conflict. Remove ffmpeg? [y/N] y

Packages (5) ffmpeg-2:6.0-8 [removal]  onevpl-2023.3.1-1
             rpi-ffmpeg-6.0.r110069.gd2aa73557f-1  svt-av1-1.7.0-1
             vmaf-2.3.1-1

Total Download Size:    0.75 MiB
Total Installed Size:  48.81 MiB
Net Upgrade Size:      15.94 MiB

:: Proceed with installation? [Y/n] Y
:: Retrieving packages...
 onevpl-2023.3.1-...   763.5 KiB   434 KiB/s 00:02 [######################] 100%
(4/4) checking keys in keyring                     [######################] 100%
(1/4) checking package integrity                   [######################] 100%
(1/4) loading package files                        [######################] 100%
(4/4) checking for file conflicts                  [######################] 100%
(5/5) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) removing ffmpeg                              [######################] 100%
(1/4) installing onevpl                            [######################] 100%
Optional dependencies for onevpl
    intel-media-sdk: runtime for legacy Intel GPUs
    onevpl-intel-gpu: runtime for Tiger Lake and newer GPUs
(2/4) installing svt-av1                           [######################] 100%
(3/4) installing vmaf                              [######################] 100%
(4/4) installing rpi-ffmpeg                        [######################] 100%
Optional dependencies for rpi-ffmpeg
    avisynthplus: for AviSynthPlus support
    ladspa: for LADSPA filters
    nvidia-utils: for Nvidia NVDEC/NVENC support
 jfl@jfl-gtkpro  /Downloads/rpi-ffmpeg-files_20230828/rpi-ffmpeg-files 

On my Manjaro-Arm-Gnome image, I had earlier installed ffmpeg-rpi-4.4.4-2 and mpv-1:0.36.0-3 (which depend on ffmpeg-4.4.4-2)…

Question: Do I need to remove mpv-1:0.36.0-3 and ffmpeg-rpi-4.4.4-2 and install the Unstable Repo mpv-1:0.36.0-1-aarch64.pkg.tar.xz?

yes Use the mpv in the repo. It is compiled for ffmpeg6. You can keep ffmpeg-rpi if you are using it for vlc.