English | 简体中文
This project provides examples of multimedia applications developed in C/C++ for the Linux environment, which can be run on the "Milk-V Duo Series" devices.
-
Use a local Ubuntu system, with Ubuntu 22.04 LTS recommended. (You can also use Ubuntu within a virtual machine, Windows Subsystem for Linux (WSL), or an Ubuntu system based on Docker.)
-
Install compilation dependencies:
sudo apt-get install wget git cmake
-
Download the cross-compilation tools:
git clone https://github.com/milkv-duo/host-tools.git
-
Obtain the Examples:
git clone https://github.com/milkv-duo/duo-media-examples.git
-
Modify the
cmake/musl_riscv64.cmake
file to setCROSS_CHAIN_PATH
:# Fixme replace with your appropriate path. set(CROSS_CHAIN_PATH "XXX/host-tools/gcc/riscv64-linux-musl-x86_64")
-
Compile and test: As an example, for the
video_recorder
, navigate to the example directory and run./build_riscv64.sh
:cd video_recorder ./build_riscv64.sh
After the compilation is successful, send the
out/videoRecorder
executable program to the Duo device through the network or USB-NCM. For example, in the case of USB-NCM which is supported by the default firmware, if the IP of Duo is 192.168.42.1, the username isroot
and the password ismilkv
.$ scp out/videoRecorder [email protected]:/root/
Once transferred, run
./videoRecorder -h
in your ssh or serial terminal to display help information:[root@milkv]~# ./videoRecorder -h usage: videoRecorder [-h] [-f flv] [-t 60] [-o out.flv] This is a simple video recording program based on milkV duo. --daemon Run application as a daemon. --umask=mask Set the daemon's umask (octal, e.g. 027). --pidfile=path Write the process ID of the application to given file. -h, --help Display help information. -f<format>, --format=<format> Specify output format: h264, flv. -t<seconds>, --time=<seconds> Specify recording duration seconds. -o<outpath>, --outpath=<outpath> Specify output path. For more information, visit the website https://milkv.io.
To record a video from the camera for 60 seconds in flv format with the output filename as
out.flv
, use the following command:./videoRecorder -f flv -t 60 -o out.flv
- Copy an existing example and modify it according to your needs.
-
video_recorder
- Record a video from the camera.
-
video_player_vo
- Uses CVITEK's Multimedia Framework for video decoding and playback.
- Note: Before playing videos, configure MIPI_DSI
-
video_player_fb
- Uses ffmpeg for video decoding and Linux framebuffer for playback.
- Note: Before playing videos, load the fb kernel module:
[root@milkv-duo]~# insmod /mnt/system/ko/cvi_fb.ko
- Visit the official website for more information.
- Join the MilkV Community for discussions and support.