Genio 350-EVK
Sections
Note
Cmd operations and test results presented in this chapter are based on the IoT Yocto v22.0 and MT8365 P1V3 (i350-EVK) board.
Supported Formats of MDP
List Video Capture formats:
v4l2-ctl --list-formats -d 2
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar
[0]: 'NM12' (Y/CbCr 4:2:0 (N-C))
[1]: 'NV12' (Y/CbCr 4:2:0)
[2]: 'NM21' (Y/CrCb 4:2:0 (N-C))
[3]: 'NV21' (Y/CrCb 4:2:0)
[4]: 'YM21' (Planar YVU 4:2:0 (N-C))
[5]: 'YM12' (Planar YUV 4:2:0 (N-C))
[6]: 'YV12' (Planar YVU 4:2:0)
[7]: 'YU12' (Planar YUV 4:2:0)
[8]: '422P' (Planar YUV 4:2:2)
[9]: 'NV16' (Y/CbCr 4:2:2)
[10]: 'NM16' (Y/CbCr 4:2:2 (N-C))
[11]: 'YUYV' (YUYV 4:2:2)
[12]: 'UYVY' (UYVY 4:2:2)
[13]: 'YVYU' (YVYU 4:2:2)
[14]: 'VYUY' (VYUY 4:2:2)
[15]: 'BA24' (32-bit ARGB 8-8-8-8)
[16]: 'AR24' (32-bit BGRA 8-8-8-8)
[17]: 'BX24' (32-bit XRGB 8-8-8-8)
[18]: 'XR24' (32-bit BGRX 8-8-8-8)
[19]: 'RGBP' (16-bit RGB 5-6-5)
[20]: 'RGB3' (24-bit RGB 8-8-8)
[21]: 'BGR3' (24-bit BGR 8-8-8)
MDPD Daemon
Like the VCODEC
driver, on i350, the MDP kernel driver delegates
most of the hardware configuration logics to userspace daemons. The daemon is mdpd
.
The daemon does not provide interfaces to other userspace clients. They only work with the kernel driver. All the video processing functionalities should be accessed through the V4L2 interface on IoT Yocto.
Therefore, the format convert processing drivers stop working if the mdpd
process is not initialized or stopped.
On IoT Yocto, the mdpd
is launched during the system boot process.
Video Decoder Codec Types
Codec |
Profile |
Max Level |
Max Bitrate |
Max Resolution |
---|---|---|---|---|
MPEG-4 |
Advanced Simple |
L5 |
40Mbps |
1080p60fps |
Simple |
L6 |
40Mbps |
1080p60fps |
|
H.264 |
Constrained Baseline (CBP) |
L4.2 |
40Mbps |
1080p60fps |
Main (MP) |
L4.2 |
40Mbps |
1080p60fps |
|
High (HiP) |
L4.2 |
40Mbps |
1080p60fps |
|
H.265 (HEVC) |
Main |
L4 |
40Mbps |
1080p60fps |
VP8 |
40Mbps |
1080p60fps |
||
VP9 |
40Mbps |
1080p60fps |
Video Encoder Codec Types
Codec |
Input Format |
Profile |
Level |
Record Spec |
---|---|---|---|---|
H.264 |
NV12, YV12, YUV420(I420), NV21 |
Baseline, Main, High |
L4.1 |
FHD60fps |
Video Encoder Extra-Controls
As a V4L2 video encoder, mtk-vcodec-enc
also provides extra-controls to set encoder capabilities.
CID |
Command(String) |
Value |
Default Value |
Note |
---|---|---|---|---|
V4L2_CID_MPEG_VIDEO_BITRATE |
video_bitrate |
1~20000000 |
20000000 |
|
V4L2_CID_MPEG_VIDEO_GOP_SIZE |
video_gop_size |
0~65535 |
0 |
size 0 means I-VOP only |
V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME |
force_key_frame |
0~0 |
0 |
to force set I-VOP on the next output frame |
V4L2_CID_MPEG_VIDEO_HEADER_MODE |
sequence_header_mode |
0~1 |
1 |
0: seperate mode, 1: joined-with-1st-frame mode. |
V4L2_CID_MPEG_VIDEO_H264_PROFILE |
h264_profile |
0, 2, 4 |
4 |
0: BASELINE, 2: MAIN, 4: HIGH |
V4L2_CID_MPEG_VIDEO_H264_LEVEL |
h264_level |
0, 2~13 |
11 |
support LEVEL_1_0~LEVEL_4_2, exclude LEVEL_1B) |
Note
Gstreamer is not fully support video header mode V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE.
For example, to compress a H.264 main profile and level 4.1 video bitstream with 512kbps bitrate:
gst-launch-1.0 -v videotestsrc num-buffers=300 ! "video/x-raw,format=NV12, width=720, height=480, framerate=30/1" ! v4l2h264enc extra-controls="cid,video_gop_size=30,video_bitrate=512000,sequence_header_mode=1" ! "video/x-h264,level=(string)4.1,profile=main" ! h264parse ! mp4mux ! filesink location=/tmp/test-h264.mp4
...
Execution ended after 0:00:01.554987154
Setting pipeline to NULL ...
Freeing pipeline ...
Note
To modify profile & level, please set it via gst-caps. If set by extra-controls directly, The profile & level will be overridden during gst caps negotiation.