HW image transitions in Python
#7
(11-21-2018, 07:05 PM)gaggleoxfoggy Wrote: I'm not getting anywhere with this.

You should check MPP (HW accelerated video encoding/decoding) and direct DRM (output image composing). DRM windows for rk3328 are described here (eg. win0 - SDR/HDR (best for video output), win1 - SDR (best for video OSD) and win2 - SDR with limited size (best for cursor)). I prepared working proof of concept example (post). You can use bionic-lxde-rock64-0.7.9-1067-arm64.img.xz.
  1. check/prepare developent environment
    Code:
    # apt list --installed | egrep 'mpp|libdrm-rockchip'
    libdrm-rockchip1/bionic,now 2.4.89-1ayufan1 arm64 [installed]
    librockchip-mpp1/bionic,now 1.4.0-1ayufan3-2 arm64 [installed,automatic]
    # apt install librockchip-mpp-dev libdrm-dev
    # ls -l /usr/lib/aarch64-linux-gnu/libdrm.so /usr/lib/aarch64-linux-gnu/libdrm_rockchip.so /usr/lib/aarch64-linux-gnu/librockchip_mpp.so
    lrwxrwxrwx 1 root root 15 Dec 19  2017 /usr/lib/aarch64-linux-gnu/libdrm.so -> libdrm.so.2.4.0
    lrwxrwxrwx 1 root root 24 Dec 19  2017 /usr/lib/aarch64-linux-gnu/libdrm_rockchip.so -> libdrm_rockchip.so.1.0.0
    lrwxrwxrwx 1 root root 20 Mar  2  2018 /usr/lib/aarch64-linux-gnu/librockchip_mpp.so -> librockchip_mpp.so.1
    # ls /usr/include/rockchip/ /usr/include/libdrm/
    /usr/include/libdrm/:
    ... drm_mode.h ... rockchip_rga.h ... drm.h  ... rockchip_drm.h .... drm_fourcc.h  ... rockchip_drmif.h  ...
    /usr/include/rockchip/:
    mpp_buffer.h  mpp_err.h  mpp_frame.h  mpp_meta.h  mpp_packet.h  mpp_task.h  rk_mpi.h  rk_mpi_cmd.h  rk_type.h  vpu.h  vpu_api.h
  2. compile and check MPP/DRM example (beware - working directly to drm framebuffer (eg. working without xserver and replace original FB when running)).
    Code:
    # git clone https://github.com/mcerveny/utils.git
    # cd utils
    # gcc -o mpi_dec -I/usr/include/rockchip -I/usr/include/libdrm -g -Wno-multichar mpi_dec.c -lrockchip_mpp -lpthread -ldrm
    # ./mpi_dec 2k60.hevc 16777220

Now there are verified MPP and DRM HW acceleration libraries.
I left this community in Aug 2019 due to PINE64 refusal to produce/deliver ROCK64-1G version 3 after more than one year of changing statuses to "planning", "evaluating", "releasing", "availability", "estimated availability" and finally "no schedule" Angry. ROCK64 is dead platform without any advantage. Buy Raspberry PI 4 !
Away


Messages In This Thread
HW image transitions in Python - by gaggleoxfoggy - 11-14-2018, 12:36 AM
RE: HW image transitions in Python - by mcerveny - 11-16-2018, 03:10 AM
RE: HW image transitions in Python - by mcerveny - 11-22-2018, 02:07 PM
RE: HW image transitions in Python - by mcerveny - 11-22-2018, 03:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python GPIO Library for the Rock64 (R64.GPIO) Leapo 37 68,793 07-02-2021, 03:20 PM
Last Post: klausfelix
  Download IDB fail when trying to flash Android image cherkasoff 0 4,354 04-05-2020, 07:41 AM
Last Post: cherkasoff
Brick How to Write an Image to the eMMC Module Tutorial MarkHaysHarris777 55 105,993 02-06-2019, 04:02 PM
Last Post: tllim
  Rock64 scipy, numpy, scikit-image, matplotlib issue with pip3 ictele 0 2,027 02-05-2019, 05:41 PM
Last Post: ictele
  flash image to sd/emmc through ethernet LMM 0 2,290 02-04-2019, 07:36 AM
Last Post: LMM
  New User - No image file in LibreELEC download Frogmella 9 9,005 06-11-2018, 01:01 PM
Last Post: Frogmella
  SDL2 and LXDE image Max11 0 1,707 05-24-2018, 01:51 AM
Last Post: Max11
  flash image directly to eMMC? gmruiz 4 6,933 01-09-2018, 05:43 AM
Last Post: Luke
  ioBroker IoT image Luke 0 2,032 11-02-2017, 03:46 AM
Last Post: Luke
Brick Rock64 Linux Image Writing Scripts Codes and Tutorial MarkHaysHarris777 4 10,712 09-09-2017, 04:03 PM
Last Post: freebsd

Forum Jump:


Users browsing this thread: 1 Guest(s)