必须使用 Rockchip BSP/vendor 内核,主线内核可能不可用;运行用户需有 /dev/dri、/dev/dma_heap、/dev/rga、/dev/mpp_service 等设备文件的访问权限;具体用法在项目 Wiki 而非 README 中。
需自行编译,README 未给出完整命令;configure 需启用 LGPLv3:./configure --enable-version3面向支持 MPP 与 RGA 的 Rockchip 平台,典型目标为 RK3588/3588s;需 Rockchip BSP/vendor 内核,README 称 5.10 与 6.1 为测试过的版本;README 未说明显存要求。
给 Rockchip 平台 FFmpeg 加 MPP 硬解硬编和 RGA 滤镜,实现全硬件零拷贝转码
为 Rockchip 芯片定制的 FFmpeg 分支,通过异步零拷贝方式接入 MPP 硬件编解码和 RGA 图像处理,让 RK3588 等 ARM 板子上的视频转码更快、更省 CPU。
核心能力
- MPP 解码器支持最高 8K 10-bit H.264/HEVC/VP9/AV1
- MPP 编码器支持异步帧级并行编码 H.264/HEVC
- RGA 滤镜做缩放、像素格式转换、裁剪、转置与叠加
- 各阶段通过 DMA 实现零拷贝
- 解码器可用 IEP 做硬件去隔行并输出 AFBC 图像
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
ffmpeg-rockchip
This project aims to provide full hardware transcoding pipeline in FFmpeg CLI for Rockchip platforms that support MPP (Media Process Platform) and RGA (2D Raster Graphic Acceleration). This includes hardware decoders, encoders and filters. A typical target platform is RK3588/3588s based devices.
Hightlights
- MPP decoders support up to 8K 10-bit H.264, HEVC, VP9 and AV1 decoding
- MPP decoders support producing AFBC (ARM Frame Buffer Compression) image
- MPP decoders support de-interlace using IEP (Image Enhancement Processor)
- MPP decoders support allocator half-internal and pure-external modes
- MPP encoders support up to 8K H.264 and HEVC encoding
- MPP encoders support async encoding, AKA frame-parallel
- MPP encoders support consuming AFBC image
- RGA filters support image scaling and pixel format conversion
- RGA filters support image cropping
- RGA filters support image transposing
- RGA filters support blending two images
- RGA filters support async operation
- RGA filters support producing and consuming AFBC image
- Zero-copy DMA in above stages
How to use
The documentation is available on the Wiki page of this project.
Codecs and filters
Decoders/Hwaccel
V..... av1_rkmpp Rockchip MPP (Media Process Platform) AV1 decoder (codec av1)
V..... h263_rkmpp Rockchip MPP (Media Process Platform) H263 decoder (codec h263)
V..... h264_rkmpp Rockchip MPP (Media Process Platform) H264 decoder (codec h264)
V..... hevc_rkmpp Rockchip MPP (Media Process Platform) HEVC decoder (codec hevc)
V..... mjpeg_rkmpp Rockchip MPP (Media Process Platform) MJPEG decoder (codec mjpeg)
V..... mpeg1_rkmpp Rockchip MPP (Media Process Platform) MPEG1VIDEO decoder (codec mpeg1video)
V..... mpeg2_rkmpp Rockchip MPP (Media Process Platform) MPEG2VIDEO decoder (codec mpeg2video)
V..... mpeg4_rkmpp Rockchip MPP (Media Process Platform) MPEG4 decoder (codec mpeg4)
V..... vp8_rkmpp Rockchip MPP (Media Process Platform) VP8 decoder (codec vp8)
V..... vp9_rkmpp Rockchip MPP (Media Process Platform) VP9 decoder (codec vp9)
Encoders
V..... h264_rkmpp Rockchip MPP (Media Process Platform) H264 encoder (codec h264)
V..... hevc_rkmpp Rockchip MPP (Media Process Platform) HEVC encoder (codec hevc)
V..... mjpeg_rkmpp Rockchip MPP (Media Process Platform) MJPEG encoder (codec mjpeg)
Filters
... overlay_rkrga VV->V Rockchip RGA (2D Raster Graphic Acceleration) video compositor
... scale_rkrga V->V Rockchip RGA (2D Raster Graphic Acceleration) video resizer and format converter
... vpp_rkrga V->V Rockchip RGA (2D Raster Graphic Acceleration) video post-process (scale/crop/transpose)
Important
- Rockchip BSP/vendor kernel is necessary, 5.10 and 6.1 are two tested versions.
- For the supported maximum resolution and FPS you can refer to the datasheet or TRM.
- User MUST be granted permission to access these device files.
# DRM allocator
/dev/dri
# DMA_HEAP allocator
/dev/dma_heap
# RGA filters
/dev/rga
# MPP codecs
/dev/mpp_service
# Optional, for compatibility with older kernels and socs
/dev/iep
/dev/mpp-service
/dev/vpu_service
/dev/vpu-service
/dev/hevc_service
/dev/hevc-service
/dev/rkvdec
/dev/rkvenc
/dev/vepu
/dev/h265e
Todo
- Support MPP VP8 video encoder
- ...
Acknowledgments
Disclaimer
This project is an UNOFFICIAL fork of FFmpeg and is NOT the property of Rockchip Electronics Co., Ltd. The MPP and RGA components used are compatible with FFmpeg by enabling the LGPLv3 license: "./configure --enable-version3".
FFmpeg README
FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata.
Libraries
libavcodecprovides implementation of a wider range of codecs.libavformatimplements streaming protocols, container formats and basic I/O access.libavutilincludes hashers, decompressors and miscellaneous utility functions.libavfilterprovides means to alter decoded audio and video through a directed graph of connected filters.libavdeviceprovides an abstraction to access capture and playback devices.libswresampleimplements audio mixing and resampling routines.libswscaleimplements color conversion and scaling routines.
Tools
- ffmpeg is a command line toolbox to manipulate, convert and stream multimedia content.
- ffplay is a minimalistic multimedia player.
- ffprobe is a simple analysis tool to inspect multimedia content.
- Additional small tools such as
aviocat,ismindexandqt-faststart.
Documentation
The offline documentation is available in the doc/ directory.
The online documentation is available in the main website and in the wiki.
Examples
Coding examples are available in the doc/examples directory.
License
FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.
Contributing
Patches should be submitted to the ffmpeg-devel mailing list using
git format-patch or git send-email. Github pull requests should be
avoided because they are not part of our review process and will be ignored.