Mpv-0.36 how to setup

I thought after drinking my mourning cup of coffee things might get clearer; but that did not happen. Did you do some sort of git merge between jc-kynesim/test/4.4.1/main and ffmpeg6.

i grab ā€˜dev/6.0/m2m_fix_format_1ā€™, branch.

Tested with this pkgbuild. Without that firefox needs ā€˜media.hardware-video-decoding.enabled falseā€™ for all the h264 videos.

pkgname=rpi-ffmpeg
pkgver=6.0.r110069.gd2aa73557f
pkgrel=1
pkgdesc='Complete solution to record, convert and stream audio and video (git version)'
arch=('aarch64')
url='https://www.ffmpeg.org/'
license=('GPL3')
depends=(
  alsa-lib
  aom
  bzip2
  fontconfig
  fribidi
  gmp
  gnutls
  gsm
  jack
  lame
  libass.so
  libavc1394
  libbluray.so
  libbs2b.so
  libdav1d.so
  libdrm
  libfreetype.so
  libgl
  libiec61883
  libjxl.so
  libmodplug
  libopenmpt.so
  libpulse
  librav1e.so
  libraw1394
  librsvg-2.so
  libsoxr
  libssh
  libtheora
  libva.so
  libva-drm.so
  libva-x11.so
  libvdpau
  libvidstab.so
  libvorbisenc.so
  libvorbis.so
  libvpx.so
  libwebp
  libx11
  libx264.so
  libx265.so
  libxcb
  libxext
  libxml2
  libxv
  libxvidcore.so
  libzimg.so
  ocl-icd
  onevpl
  opencore-amr
  openjpeg2
  opus
  sdl2
  speex
  srt
  svt-av1
  v4l-utils
  vmaf
  vulkan-icd-loader
  xz
  zlib
)
makedepends=(
  amf-headers
  avisynthplus
  clang
#  ffnvcodec-headers
  git
  ladspa
  mesa
  nasm
  opencl-headers
  vulkan-headers
)
optdepends=('avisynthplus: for AviSynthPlus support'
            'ladspa: for LADSPA filters'
            'nvidia-utils: for Nvidia NVDEC/NVENC support'
            'onevpl-intel-gpu: for Intel Quick Sync Video')
provides=('libavcodec.so' 'libavdevice.so' 'libavfilter.so' 'libavformat.so'
          'libavutil.so' 'libpostproc.so' 'libswresample.so' 'libswscale.so'
          'ffmpeg')
conflicts=('ffmpeg' 'ffmepg-git')
source=('git+https://github.com/jc-kynesim/rpi-ffmpeg.git#branch=dev/6.0/rpi_import_1'
        '040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch'
        '060-ffmpeg-fix-segfault-with-avisynthplus.patch')
sha256sums=('SKIP'
            'd1ad786df86354d218a70b306a50961736c0a6e2d2716bf8de3db31d79957df9'
            'bf563193f450ece58a93db6840c0db33875df945fa81477b9b02fb209d3bf57a')

prepare() {
    patch -d rpi-ffmpeg -Np1 -i "${srcdir}/040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch"
    patch -d rpi-ffmpeg -Np1 -i "${srcdir}/060-ffmpeg-fix-segfault-with-avisynthplus.patch"
}

pkgver() {
    printf '%s.r%s.g%s' "$(git -C rpi-ffmpeg describe --tags --long | awk -F'-' '{ sub(/^n/, "", $1); print $1 }')" \
                        "$(git -C rpi-ffmpeg describe --tags --match 'N' | awk -F'-' '{ print $2 }')" \
                        "$(git -C rpi-ffmpeg rev-parse --short HEAD)"
}

build() {
    cd rpi-ffmpeg
    printf '%s\n' '  -> Running ffmpeg configure script...'
    
    ./configure \
        --prefix='/usr' \
        --disable-debug \
        --disable-static \
        --disable-stripping \
        --enable-amf \
        --enable-avisynth \
        --enable-cuda-llvm \
        --enable-lto \
        --enable-fontconfig \
        --enable-gmp \
        --enable-gnutls \
        --enable-gpl \
        --enable-ladspa \
        --enable-libaom \
        --enable-libass \
        --enable-libbluray \
        --enable-libbs2b \
        --enable-libdav1d \
        --enable-libdrm \
        --enable-libfreetype \
        --enable-libfribidi \
        --enable-libgsm \
        --enable-libiec61883 \
        --enable-libjack \
        --enable-libjxl \
        --enable-libmodplug \
        --enable-libmp3lame \
        --enable-libopencore_amrnb \
        --enable-libopencore_amrwb \
        --enable-libopenjpeg \
        --enable-libopenmpt \
        --enable-libopus \
        --enable-libpulse \
        --enable-librav1e \
        --enable-librsvg \
        --enable-libsoxr \
        --enable-libspeex \
        --enable-libsrt \
        --enable-libssh \
        --enable-libsvtav1 \
        --enable-libtheora \
        --enable-libv4l2 \
        --enable-libvidstab \
        --enable-libvmaf \
        --enable-libvorbis \
        --enable-libvpl \
        --enable-libvpx \
        --enable-libwebp \
        --enable-libx264 \
        --enable-libx265 \
        --enable-libxcb \
        --enable-libxml2 \
        --enable-libxvid \
        --enable-libzimg \
        --enable-opencl \
        --enable-opengl \
        --enable-shared \
        --enable-version3 \
        --enable-vulkan \
        --disable-ffnvcodec \
        --disable-nvdec \
        --disable-nvenc \
        --disable-vdpau \
        --enable-sand \
        --enable-v4l2-request \
        --enable-vout-drm \
        --enable-vout-egl \
        --enable-libudev \
        --enable-epoxy

    make
    make tools/qt-faststart
}

package() {
    make -C rpi-ffmpeg DESTDIR="$pkgdir" install
    install -D -m755 rpi-ffmpeg/tools/qt-faststart -t "${pkgdir}/usr/bin"
}

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: