Jump to content

Khánh Ngô

Members
  • Posts

    3
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Khánh Ngô reacted to jock in Repository for v4l2request hardware video decoding (rockchip, allwinner)   
    Hello, this quick tutorial is to introduce an experimental Debian and Ubuntu APT repository to install ffmpeg and mpv compiled with v4l2request and v4l2drmprime patches developed by Linux kernel, LIbreELEC and Kodi folks to allow hardware video decoding on stateless decoders like those implemented in Rockchip and Allwinner SoCs for h.264, h.265, vp8 and vp9 codecs.
     
    The repository introduces a new package ffmpeg-v4l2request that integrates and substitues the base ffmpeg package and its related packages.
    Also provides mpv 0.35.1 for Ubuntu Jammy, which has an overrall better support for hardware video decoders.
     
    Preconditions:
    Kernel should be 6.1 or more recent armhf or arm64 architecture Supported operating systems are Debian Bookworm and Ubuntu Jammy Rockchip and Allwinner have already been tested, but this should work on other platforms with stateless decoders supported in kernel  
    APT REPOSITORY SETUP
    To install the repository, just copy and paste the lines for your operating system in a terminal
     
    For Debian Bookworm:
    $ sudo wget http://apt.undo.it:7241/apt.undo.it.asc -O /etc/apt/trusted.gpg.d/apt.undo.it.asc $ echo "deb http://apt.undo.it:7241/debian bookworm main" | sudo tee /etc/apt/sources.list.d/apt.undo.it.list  
    For Ubuntu Jammy:
    $ sudo wget http://apt.undo.it:7241/apt.undo.it.asc -O /etc/apt/trusted.gpg.d/apt.undo.it.asc $ echo "deb http://apt.undo.it:7241/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/apt.undo.it.list  
    INSTALL FFMPEG AND MPV PACKAGES
    $ sudo apt update $ sudo apt install ffmpeg-v4l2request mpv  
    SETUP MPV CONFIG FILE
    $ sudo mkdir -p /etc/mpv $ echo -e "hwdec=drm\ndrm-drmprime-video-plane=primary\ndrm-draw-plane=overlay" | sudo tee /etc/mpv/mpv.conf  
    You can now play your videos using mpv and they should run with hardware decoding if supported, either in virtual terminals or in X11/Wayland windows!
    Enjoy!
     
    Notes:
    your mileage may vary a lot: the more recent is the kernel version, the better is support (you may need edge kernel) bug: when rendered in X11/Wayland window, video may show scattered tiles during frames bug: Lima driver (Mali 400/450) shows a red/pink tint when video is played in X11/Wayland (see https://github.com/mpv-player/mpv/issues/12968) (workaround below: https://forum.armbian.com/topic/32449-repository-for-v4l2request-hardware-video-decoding-rockchip-allwinner/?do=findComment&comment=177968) Panfrost driver should work flawlessy 10 bit HEVC are generally supported on all Rockchip devices (rk322x, rk3288, rk33x8, rk3399), but Allwinner H3 have no hardware support for that  
     
     
  2. Like
    Khánh Ngô reacted to blust0ne in R69-EMCP v2.0 ALLWINNER H3   
    Orange Pi PC image work well with above u-boot image. (xfce desktop runs)
     
    if you have MXQ-HX-V2.0 board  , try Orangepipc_2.0.8_ubuntu_focal_desktop_linux5.4.65
     
    Burn orangePi image to SDCARD and then patch the u-boot region 0x2000 with above u-boot image.
     
    RetrOrangePi_v4.3_Armbian_5.91_Sunvell-r69_Ubuntu_bionic_dev_5.3.9_desktop.img also works.
     
    LibreELEC 10.0.4, 10.0.0, 11.0.3 can boot , copy the sun8i-h3-libretech-all-h3-cc.dtb from Orangepipc_2.0.8_ubuntu_focal_desktop_linux5.4.65 image and edit the /extlinux/extlinux.conf.
     
    In my guess , kernel version 5.3.x 5.4.x image may work.
  3. Like
    Khánh Ngô reacted to ning in Amlogic or Rockchip?   
    I like H3.
  4. Like
    Khánh Ngô got a reaction from Đức Nhâm Huỳnh in Testing hardware video decoding (rockchip, allwinner?)   
    I tested on Ubuntu Jammy 5.15.80 (using mpv binary jammy in your folder) on H3 chip. It works like a charm. 
    1080p (h264) was tested with 4 frame drops (10min video).
     
    Using this command:
    mpv --vo=gpu --hwdec=drm <video.mp4>  
     
    But, i want to use --script-opts, --ytdl-raw-options, --ytdl-format. I can use it in mpv from apt-get but your mpv can't parse.
    Error parsing option ytdl-format (option not found) Setting commandline option --ytdl-format= failed.  
    Can you compile again for jammy with that feature support, please? 
     
    That's great for those who want to listen to music and videos from YouTube like me.
     
    Thank you.
  5. Like
    Khánh Ngô reacted to jock in Testing hardware video decoding (rockchip, allwinner?)   
    !! DEPRECATED !!
    Instructions in this thread are oudated and superseded by the new experimental APT repository for hardware video decoding ffmpeg.
    Please refer to this thread from now on!
     
    Hello, recent upgrades to armbian are regarding kernel 5.15.
    I noticed that many v4l2 fixes and enhancements went into this release, so I decided to compile ffmpeg using LibreELEC patched version and mpv over it.
    mpv turns out to be statically linked with ffmpeg, so I propose it here for people who is interested in cutting edge kernel and wants to do some tests.
     
    This has been tested on Debian Bullseye and Ubuntu Hirsute on following platforms:
    Rockchip RK3228/9 (kernel 5.10, 5.14) Rockchip RK3288 (kernel 5.14) Rockchip RK3318/28 (kernel 5.15)  
    It should work on allwinner platforms too, but I didn't test it there.
    Binaries are built by me on developing boards.
     
    The binary for armhf is available here
    The binary for arm64 is available here
     
    Copy the binary into /usr/local/bin directory of your system (mpv-armhf for 32 bit systems, mpv-arm64 for 64 bit systems):
    sudo cp mpv-armhf /usr/local/bin/mpv  
    Install dependencies for Debian Bullseye and Ubuntu Hirsute:
    apt install libass9 libbluray2 librubberband2 libsdl2-2.0-0 libva-drm2 libva-wayland2 libva-x11-2 libva2 libvdpau1 libx264-160 libx265-192 libxss1 libxv1 libfdk-aac2  
    I have had issues with dependencies on Debian Buster/Ubuntu Focal, in particular libx264-160 and libx265-192 are not available there.
    I Solved the issue downloading the packages from Debian Bullseye web page and manually installing them.
    There may be the need for some other dependency depending upon your actual installation.
     
    Run mpv in a virtual terminal (videos up to 4K) with this CLI:
    mpv --vo=gpu --hwdec=drm --gpu-hwdec-interop=drmprime-drm --drm-draw-plane=overlay --drm-drmprime-video-plane=primary <video.mp4>  
    Mpv can be run in X11 with this other CLI, but due to buffer copying it requires a good CPU - rk3228 and rk3328 won't even play 720p, rk3288 do 720p fine:
    mpv --vo=gpu --hwdec=auto-copy --gpu-context=x11egl --gpu-hwdec-interop=drmprime-drm <video.mp4>  
    This is an experiment and your mileage may vary a lot:
    H.264 codec should be well supported around the boards; H.265 has more limited support VP8 should be generally supported VP9 seems to still require some work.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines