Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gpu decode #38

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

zjzhang-cn
Copy link
Collaborator

修复Intel GPU解码问题

@cloudwebrtc
Copy link
Member

LGTM

@Meonardo
Copy link

Meonardo commented Aug 9, 2022

尝试用新的代码进行解码, 渲染发现色度不对, 如下图展示:
左边正常
image

@zjzhang-cn
Copy link
Collaborator Author

根据你的图片,应该YUV格式的问题。 你能帮忙跟踪一下 FourCC的数值吗
image

@Meonardo
Copy link

Meonardo commented Aug 9, 2022

一样的,
image

@zjzhang-cn
Copy link
Collaborator Author

谢谢, 找到原因了 ,你替换这行代码
libyuv::NV12ToI420(pData->Y, pData->Pitch, pData->UV, pData->Pitch, i420_buffer->MutableDataY(), i420_buffer->StrideY(), i420_buffer->MutableDataU(), i420_buffer->StrideU(), i420_buffer->MutableDataV(), i420_buffer->StrideV(), frame_info.Width, frame_info.Height);

@Meonardo
Copy link

找到原因了 ,你替换这行代码

现在色度是准确的👍, 但是我觉这里用 Pitch / 2 作为 src_stride_uv 是没问题的🤔.

@zjzhang-cn
Copy link
Collaborator Author

nv12的uv分量是交错的,所以每行的字节与y分量是一样的。

@Meonardo
Copy link

nv12的uv分量是交错的,所以每行的字节与y分量是一样的。

懂了, 我以为是单个 U / V, 多谢指点!

@nikohpng
Copy link
Contributor

nikohpng commented Apr 11, 2023

在i5-7200u中, gpu为 intel HD Graphics 620 中,解码没问题,编码出现远端查看只渲染一帧画面就卡死了。
Update:

// Finally init the encoder
  sts = m_pmfx_enc_->Init(&m_mfx_enc_params_);
  if (MFX_WRN_PARTIAL_ACCELERATION == sts) {
    sts = MFX_ERR_NONE;
  } else if (MFX_WRN_INCOMPATIBLE_VIDEO_PARAM == sts) {
    RTC_LOG(LS_ERROR) << "Invalid video param detected.";
  } else if (MFX_ERR_NONE != sts) {
    return WEBRTC_VIDEO_CODEC_ERROR;
  }

错误日志如下:

(video_source_sink_controller.cc:89): Pushing SourceSink restrictions: max_fps=60 max_pixel_count=2147483647 target_pixel_count=null resolutions={1280x720}
(msdkvideoencoder.cc:137): InitEncodeOnEncoderThread: maxBitrate:62914framerate:60targetBitRate:62914frame_height:720frame_width:1280
(msdkvideoencoder.cc:295): Invalid video param detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants