Code Monkey home page Code Monkey logo

libv4l-rkmpp's Introduction

libv4l-rkmpp

A V4L2 plugin that wraps rockchip-mpp for the chromium's V4L2 VDA/VEA (requires custom patches to enable those features).

The original idea comes from v4l-gst.

Dependencies

Building

   $ meson build
   $ meson compile -C build

Quick Start

  1. Install libv4l-rkmpp.so into /usr/lib/libv4l/plugins/

  2. Create dummy V4L2 device files for chromium VDA/VEA in boot service:

   # echo dec > /dev/video-dec0
   # chmod 666 /dev/video-dec0
   # echo enc > /dev/video-enc0
   # chmod 666 /dev/video-enc0
  1. Configure codec capabilities

    The codec capabilities (depends on chip spec) are configurable in device files:

   # cat /dev/video-dec0
   log-fps=1
   log-level=2
   type=dec
   codecs=VP8:VP9:H.264:H.265:AV1
   max-height=1920
   max-width=1080
  1. Run chromium's VDA/VEA

    The VDA's thumbnail tests would fail, which is harmless since we are not in the md5 checksum list

    The VEA's CacheLineUnalignedInputTest test might crash, which is due to VEA buffer managing issue.

  2. Run with chromium browser:

   export XDG_RUNTIME_DIR=/run/user/0
   chromium --no-sandbox --gpu-sandbox-start-early --ignore-gpu-blacklist

This plugin is tested with custom chromium on rk3399

Limitation

  1. There're a lot of chromium related hacks in it, might not work for other apps.

    For proper decoding usage, there's a ffmpeg solution with a few extra buffer copies.

FAQ

  1. MPP reports errors?

    Try the newest MPP release branch or develop branch or the commit with the closest commit date.

    Also test with the mpi_dec_test to check if the MPP works:

# mpi_dec_test -t 7 -i test-25fps.h264
  1. The plugin complaining about "ERR: failed to init rga"?

    Make sure "/dev/rga" exists and accessable by the chromium.

  2. How to get more verbose logs?

    For chromium, use these command line flags to change the log level: --enable-logging --vmodule=/media/gpu=4

    For libv4l-rkmpp, set the "LIBV4L_RKMPP_LOG_LEVEL" environment variable to change the log level. And set "LIBV4L_RKMPP_LOG_FPS" to enable logging fps.

    For MPP, set the environment variable "mpp_debug", "rkv_h264d_debug", "mpp_dec_debug", "mpi_debug", etc. to change the modules' log levels.

    For vpu driver, write verbose log level to "/sys/module/rk_vcodec/parameters/debug".

  3. What about the performance?

    The performance should be much the same as other MPP based decoders/encoders (e.g. mpi_dec_test and gstreamer MPP plugin).

    And the performance would mostly related to the video's attributes (e.g. resolution and bitrate) and the vpu clock rates.

Maintainers

libv4l-rkmpp's People

Contributors

jeffycn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.