rockchip-linux / mpp

Media Process Platform (MPP) module
548 stars 164 forks source link

mpph264enc rotation issues | rotation 设施问题 #183

Closed billythedummy closed 2 years ago

billythedummy commented 3 years ago

device/模型: RK3399

Output video from this GST pipeline (rotation=0) 以下GST流水线(rotation=0)输出的视频

gst-launch-1.0 -e v4l2src ! mpph264enc rotation=0 ! h264parse ! mp4mux ! filesink location=test.mp4

is the same as output video from this GST pipeline (rotation=2) 与以下流水线输(rotation=2)出的视频是一模一样的

gst-launch-1.0 -e v4l2src ! mpph264enc rotation=2 ! h264parse ! mp4mux ! filesink location=test.mp4

This pipeline (rotation=1) causes the entire rk3399 device to crash (unresponsive) 以下GST流水线(rotation=1)导致rk3399死机

gst-launch-1.0 -e v4l2src ! mpph264enc rotation=1 ! h264parse ! mp4mux ! filesink location=test.mp4

The output video from this pipeline (rotation=3) is severely distorted with the whole video comprising vertical bars 以下GST流水线(rotation=3)输出的视频画面完全以条条竖线构成

gst-launch-1.0 -e v4l2src ! mpph264enc rotation=3 ! h264parse ! mp4mux ! filesink location=test.mp4

For rotation=1 and rotation=3, this mpp error message was observed (rotation=1) 和 (rotation=3) 流水线跑的时候输出了以下信息

mpp[1413]: hal_h264e_vepu_v2: warnning: input buffer size 0x2fd000 is smaller than required size 0x384000

More Setup Info:

JeffyCN commented 3 years ago

i can repro this issue on rk3399 evb(with 4.4/4.19 BSP kernel), but seems like rk356x(with 4.19 kernel) work well. might due to different IP related code in MPP.

@HermanChen

JeffyCN commented 3 years ago

well, checking the MPP code: mpp-release# cgrep rotation -wl ... ./mpp/hal/rkenc/h264e/hal_h264e_vepu541.c <--- it's the only h264e hal which supports rotation property ./mpp/hal/rkenc/h264e/hal_h264e_vepu541_reg.h ... ./mpp/codec/enc/h264/h264e_api_v2.c <--- provide rotation property and switches w&h, that cause memory error when hardware not supporting rotation

the h264e_api_v2.c provides rotation property, but only rkenc support it. so only these chips(with rkvenc module) can to rotation for h264e:

mpp-release# ag HAVE_RKVENC osal/mpp_soc.cpp -B 1 517- ROCKCHIP_SOC_RV1108, 518: HAVE_VDPU2 | HAVE_VEPU2 | HAVE_RKVDEC | HAVE_RKVENC,

529- ROCKCHIP_SOC_RV1109, 530: HAVE_VDPU2 | HAVE_VEPU2 | HAVE_RKVDEC | HAVE_RKVENC,

541- ROCKCHIP_SOC_RV1126, 542: HAVE_VDPU2 | HAVE_VEPU2 | HAVE_RKVDEC | HAVE_RKVENC,

585- ROCKCHIP_SOC_RK3566, 586: HAVE_VDPU2 | HAVE_VDPU2_PP | HAVE_VEPU2 | HAVE_RKVDEC | HAVE_RKVENC | HAVE_JPEG_DEC,

598- ROCKCHIP_SOC_RK3568, 599: HAVE_VDPU2 | HAVE_VDPU2_PP | HAVE_VEPU2 | HAVE_RKVDEC | HAVE_RKVENC | HAVE_JPEG_DEC,

JeffyCN commented 2 years ago

the newest gst mpp plugin would use rga to rotate: https://github.com/JeffyCN/rockchip_mirrors/commit/c27f61d63aeea7104afab971902f0fc1b7680aed