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

improve oneVPL's user experience #271

Open
dyang23 opened this issue Mar 2, 2023 · 1 comment
Open

improve oneVPL's user experience #271

dyang23 opened this issue Mar 2, 2023 · 1 comment
Assignees
Labels
Decode Video Decoding Feature Request Request a feature or enhancement

Comments

@dyang23
Copy link

dyang23 commented Mar 2, 2023

System information

  • GPU platform enabling for new feature: NV
  • Host machine if it's discrete card: NV
  • libva/libva-utils/gmmlib/media-driver/VPL runtime version you are using? NV
  • Are you willing to contribute it?(Yes/No) No

Feature Information

Describe the feature and expected behavior

Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data.
This is a little cumbersome for developers, and it is difficult to get started.

Customer usage and impact for this feature

int NvDecoder::Decode(const uint8_t *pData, int nSize, int nFlags, int64_t nTimestamp)
{
m_nDecodedFrame = 0;
m_nDecodedFrameReturned = 0;
CUVIDSOURCEDATAPACKET packet = { 0 };
packet.payload = pData;
packet.payload_size = nSize;
packet.flags = nFlags | CUVID_PKT_TIMESTAMP;
packet.timestamp = nTimestamp;
if (!pData || nSize == 0) {
packet.flags |= CUVID_PKT_ENDOFSTREAM;
}
NVDEC_API_CALL(cuvidParseVideoData(m_hParser, &packet));

return m_nDecodedFrame;

}

The video bitstream pData is fed into parser using NVDECODE API cuvidParseVideoData() directly.

Application must register a function to handle any sequence
change. Parser triggers pfnSequenceCallback callback for initial sequence header or when it encounters a video format change.

Parser triggers pfnDecodePicture callback when bitstream data for one frame is
ready. In case of field pictures, there may be two decode calls per one display call since two fields make up one frame.

Parser triggers pfnDisplayPicture callback when a frame in display order is ready.

bool MFXFrameConstructor::PrepareFrame(const uint8_t* data, uint32_t size, uint64_t pts) {
bool ret = true;
MFX_ZERO_MEMORY(mBitstream);

switch (mFrameType) {
case MFX_FRAME_AVC:
ret = PrepareAVCFrame(data, size, pts);
break;
case MFX_FRAME_HEVC:
ret = PrepareHEVCFrame(data, size, pts);
break;
default:
MC_LOG("Unsupported codec!");
ret = false;
break;
}

return ret;
}


Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data.
This is a little cumbersome for developers, and it is difficult to get started.

**Additional context**
Add any other context or screenshots about the feature request here.
@dyang23 dyang23 added the Feature Request Request a feature or enhancement label Mar 2, 2023
@Sherry-Lin Sherry-Lin added the Decode Video Decoding label Mar 2, 2023
@intel-mediadev
Copy link
Contributor

Auto Created VSMGWL-63154 for further analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Decode Video Decoding Feature Request Request a feature or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants