This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
团队、
编码器 API 现在有一个限制、它是一个重要的阻止程序。 我们需要有一种方法在编码配置文件之间切换(主要是 hgih-profile 和 base-profile)。 请参见下面的。
我们还看到 H264编码器驱动程序的另一个问题:没有 V4L2控制来选择编码配置文件。 我们需要为 h264设置基本配置文件(通常我们需要能够选择配置文件)。
现在、默认情况下、只有高配置文件设置可用、V4L2控制列表受限、并且没有配置文件设置选项:
v4l2-ctl --list-CtrlS --device=/dev/video1
GOP_SIZE 0x009909cb (int):最小值=1最大值=7200步进=1默认值=1800值=1800
VIDEO_bitrate 0x009909CF (int):min=50000 max=100000000 step=1 default=500000 value=0
h264_i_period 0x00990a66 (int):min=1 max=600 step=1 default=30 value=0
您好!
以下2个补丁使用户能够为使用 GStreamer 的视频编码提供用户定义的配置文件。
电路板:J721e (TDA4VM)
SDK 版本:8.4.
修补程序1: 应用于 Gstreamer 插件。
修补程序文件名: 0001-added-H264-profiles-support-to -Gstreamer-Plug-for-.patch
要应用补丁、用户需要设置 Yocto、要设置 Yocto、请参阅 SDK 文档。 Yocto 构建准备就绪后、可以在以下位置找到 GStreamer 插件:
/yocto-build/build/arago-tmp-external-arm-glibc/work/j7_evm-linux/gstreamer1.0-plugins-good/1.16.3-r0.0.arago3_psdkla_0/gst-plugins-good-1.16.3
可以从此文件夹应用补丁、并对文件进行更改:
/sys/v4l2/gstv4l2h264enc.c 和/sys/v4l2/gstv4l2h264enc.h
补丁程序2: 应用于 Linux 内核
修补程序文件名: 0001-added-H264-Profiles-support-to-IMG-Video-Encode-drivv.patch
Linux 内核的位置:
ti-processor-sdk-linux-j7-evm-08_04_00_11/board-support/linux-5.10.120+gitAUTOINC+95b90aa828-g95b90aa828
应用此文件夹中的修补程序,并对该文件进行更改:
/drivers/media/platform/vxe-vxd/encoder/vxe_v4l2.c
应用这两个补丁后、可通过以下命令验证驱动程序。 对于 Base、使用 profile=0;对于 Main、使用 profile=2;对于 High、使用 profile=4。 对于任何其他值、将设置默认基本配置文件。
$ GST-LAUNCH-1.0 videotestsrc pattern=ball do timestimate=true num-buffers=100 ! VIDEO/x-RAW、FORMAT=NV12、width=852、height=480、framerate=30/1! v4l2h264enc 配置文件=2! h264parse! mp4 mux! 文件链接位置= demo_main.mp4
文件的配置文件可使用 ffmpeg 进行验证,并且还会为使用上述命令创建的视频附加 ffmpeg 日志。
e2e.ti.com/.../3223.0001_2D00_Added_2D00_H264_2D00_Profiles_2D00_support_2D00_to_2D00_IMG_2D00_Video_2D00_Encode_2D00_driv.patch
e2e.ti.com/.../5658.ffmpeg_5F00_profile_5F00_check.log
此致
Nikshith
您好 Nikshith、
对于基础配置文件、这不起作用:流仍然是高配置文件。 您能否进行双重检查?
共享的2个修补程序在强制执行基本配置文件后工作。 可通过更改强制使用基本系统配置
CTX->vparams.h264_8x8 = false;
CTX->vparams.cabac_enabled =错误;
1 file changed, 2 insertions(+), 2 deletions(-) drivers/media/platform/vxe-vxd/encoder/vxe_enc.c | 4 ++-- modified drivers/media/platform/vxe-vxd/encoder/vxe_enc.c @@ -353,10 +353,10 @@ void vxe_fill_default_params(struct vxe_enc_ctx *ctx) ctx->vparams.slices_per_picture = 1; ctx->vparams.is_interleaved = FALSE; ctx->vparams.constrained_intra = FALSE; - ctx->vparams.h264_8x8 = TRUE; + ctx->vparams.h264_8x8 = FALSE; ctx->vparams.bottom_field_first = FALSE; ctx->vparams.arbitrary_so = FALSE; - ctx->vparams.cabac_enabled = TRUE; + ctx->vparams.cabac_enabled = FALSE; ctx->vparams.cabac_bin_limit = 2800; ctx->vparams.cabac_bin_flex = 2800; ctx->vparams.deblock_idc = 0;
这是接收到的反馈。
"This patch is not valid 0001-Added-H264-Profiles-support-to-IMG-Video-Encode-driv.patch It provides ioctl control to set encoder properties and forces profile but the profile is still overwritten after VIDIOC_S_FMT is called. Handler of set format ioctl in driver is vxe_s_fmt() and it calls find_profile() and overwrites profile setting. When we revert our original hack to force find_h264_profile() to return "base profile" (cabac_enabled = FALSE; h264_8x8 = TRUE) then the patch you shared simply doesn't work for base-profile cases."
vxe_s_fmt 调用的 find_h264_profile()仅根据 struct vxe_enc_ctx * ctx 中的变量返回配置文件
**当我们恢复原始的 Hack 以强制 find_h264_profile()返回“基本配置文件”时(CABAC_ENABLED = false; h264_8x8 = true)。 **
共享的 hack 会使"CABAC_ENABLED = false; h264_8x8 = false "。
此致
Nikshith
按照今天的通话商定的方式结束本次会议。