Skip to content

Latest commit

 

History

History
90 lines (69 loc) · 5.45 KB

README.rpi.md

File metadata and controls

90 lines (69 loc) · 5.45 KB

MDK: Multimedia Development Kit

Use generic linux sdk package for raspberry pi3/4 with modern RaspberryPi OS

Features

About SDK for Legacy Raspberry Pi

SDK is cross built by clang 17 with

SDK can be used by any C or C++11 compiler, e.g. g++, clang

pi 4: ALSA_DEVICE=sysdefault

clang >= 9 result dso can not be loaded on rpi1, maybe there is a bug in lld

  • gapless playback hardware decoders may requires 256M GPU memory
  • OpenGL
  • OpenGL ES2/3
  • mmal: builtin mmal decoder implementation
  • MMAL: FFmpeg mmal decoder implementation
  • V4L2: or "FFmpeg:hwaccel=v4l2m2m"

Examples

In legacy driver environment, hardware decoder (MMAL, mmal) supports zero copy rendering in GLES2 and has the best performance

  • legacy driver gles2: ./window -c:v MMAL test.mp4

In mesa vc4/6 driver environment(fake/full kms), hardware decoder is available, but zero copy rendering is not

  • vc4/6 egl+es2: LD_PRELOAD=libX11.so.6 ./window -c:v MMAL test.mp4 # if not link against libX11(except weak) or libpulse
  • vc4/6 glx: GL_ES=0 LD_PRELOAD=libGL.so.1 ./window -c:v MMAL test.mp4 # if not link against libGL or libOpenGL
  • vc4/6 wayland: ./window -c:v MMAL test.mp4 # assume weston is running in x11 or CLI mode via weston-launch
  • vc4/6 gbm: ./window -surface gbm -c:v MMAL test.mp4 # assume weston is running # in CLI mode

Tested on rpi1 and rpi3.

Note: the latest sdk links against libGL.so.1, so no need to set LD_PRELOAD.

Use in CMake Projects

	include(mdk-sdk-dir/lib/cmake/FindMDK.cmake)
	target_link_libraries(your_target PRIVATE mdk)

Qt qmake project

include($$MDK_SDK_DIR/mdk.pri)

Live streams (RTSP, RTMP etc.) low latency

    player.setProperty("avformat.fflags", "+nobuffer");
    player.setProperty("avformat.fpsprobesize", "0");

Source code:

Copyright (c) 2016-2024 WangBin(the author of QtAV) Free for opensource softwares, non-commercial softwares, flutter, QtAV donors and contributors.