Multimedia Framework (MMF) Development Guide
Update history
| Date | Version | Author | Update content |
|---|---|---|---|
| 2024-02-04 | v0.1 | lxowalle |
|
Overview
This document introduces how to use the SDK to develop with MMF, providing a starting point for developers who want to begin MMF development.
MMF stands for Multimedia Framework, a framework that offers a unified API for video input/output, audio input/output, image signal processing, and hardware encoding/decoding, allowing users to quickly implement multimedia-related functions by calling these APIs.
Build MMF development environment
Please refer to the method introduced in LicheeRV Nano->System Development->cvi_mmf_sdk to build the MMF development environment.
Or follow the instructions below:
# Download dependencies
sudo apt install pkg-config build-essential ninja-build automake autoconf libtool wget curl git gcc libssl-dev bc slib squashfs-tools android-sdk-libsparse-utils android-sdk-ext4-utils jq cmake python3-distutils tclsh scons parallel ssh-client tree python3-dev python3-pip device-tree-compiler libssl-dev ssh cpio squashfs-tools fakeroot libncurses5 flex bison
# Download SDK and toolchain
git clone https://github.com/sipeed/LicheeRV-Nano-Build.git
wget https://sophon-file.sophon.cn/sophon-prod-s3/drive/23/03/07/16/host-tools.tar.gz
tar xvf host-tools.tar.gz
# Compile all examples with the build_middleware command
cd LicheeRV-Nano-Build
git checkout v4.1.0-licheervnano
ln -s ../host-tools ./
source build/cvisetup.sh
defconfig cv1812cp_licheerv_nano_sd
build_middleware
The above instructions describe how to install the MMF-related compilation environment and how to compile the MMF examples provided by the SDK.
- Note: Compiling sample_cvg may fail. If you do not need this example, try again after deleting the
LicheeRV-Nano-Build/middleware/v2/sample/cvgfolder. If you need this demo, try compiling withbuild_all, which requires compiling the entire SDK, so the compilation time will be longer.
Development Documentation
Please refer to LicheeRV Nano->Board Introduction to find most of the documentation.
For MMF applications, pay attention to the following documents:
Connecting to the Development Board via Network
The purpose of connecting to the development board via the network is to upload the firmware you compiled to the board.
Please refer to the methods in LicheeRV Nano->peripheral to get the IP address of the development board. Any one of the three methods can be used: Ethernet connection, WiFi connection, or USB RNDIS connection.
Compiling and Running an Example
MMF accesses hardware directly, so incorrect usage can lead to a system crash. Pay careful attention to details when developing with MMF. It is recommended to base your program on the provided examples.
Compile and run sample_vio example:
# Ensure that the basic MMF compilation environment has been set up and that build_middleware has been compiled once
# Compile sample_vio
cd middleware/v2/sample/vio
make
# Upload to the development board (account root, password cvitek)
scp sample_vio root@xxx.xxx.xxx.xxx:/root # xxx.xxx.xxx.xxx is the board's IP address
# Log into the development board
ssh root@xxx.xxx.xxx.xxx
# If you need to use the display, you need to run fb_load.sh to make sure the driver is loaded (it only needs to be executed once)
/opt/fb_load.sh
# Run the example
cd ~
./sample_vio
The instructions above explain how to compile a specific MMF example, and how to upload and run the example on the development board. Developers can modify the example based on their applications to eventually develop the functionality they desire.
Have an unsolvable problem?
- Please remain patient and carefully review the development documentation to see if anything was overlooked. For example, check if the input parameters are correct, whether resources have been properly released, etc.
- Post your problem on maixhub or GitHub. Please describe the functionality you want to achieve, the problems you encountered, the solutions you tried, and the steps to reproduce them. Many issues can be resolved in the process of organizing your thoughts.