Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

multi-thread

hui1234
Beginner
1,510 Views
Hi


Media SDK2.0 do have support for multi-threaded?

If you can

Will there be data loss caused by the implementation of failure?

Thanks

0 Kudos
5 Replies
IDZ_A_Intel
Employee
1,510 Views
Hi,

Yes, Intel Media SDK is multi-threaded and also supports writing multi-threaded applications using the SDK.

I do not understand what you mean by "Will there be data loss caused by the implementation of failure?". Can you please elaborate?

Regards,
Petter
0 Kudos
hui1234
Beginner
1,510 Views
Hi Petter

I use multi-threaded implementation of media SDK2.0 sample_decode.


I would like to decode the different files at the same time.

However, the implementation will generate an error

The error is a memory to be modified

0 Kudos
gthomaz
Beginner
1,510 Views
Could you give more details?
At first moment, seems that you have a problem with your multithread implementation, not with SDK...
Please give us more details, like where you got this error, what filters are you using, how they are connected...

0 Kudos
hui1234
Beginner
1,510 Views

Hi

1.Multi-threading can be implemented
2.It is normal for a thread.(The size of any resolutions)
3.8 threads about executable in a small resolutions(ex. 352x288).More than 8 threads will produce memory errors
4.2 threads about executable in a large resolutions(ex. 1280x1024).More than2 threads will produce memory errors
5.m_mfxBS.DataLength and m_mfxBS.Data dataare valid, but m_mfxBS.DataLength will be changed in the implementation of m_pmfxDEC->DecodeHeader

mfxStatus CDecodingPipeline::InitMfxParams(mfxU32 &numViews)

{

MSDK_CHECK_POINTER(m_pmfxDEC, MFX_ERR_NULL_PTR);

mfxStatus sts = MFX_ERR_NONE;

for(;;)

{

sts = m_pmfxDEC->DecodeHeader(&m_mfxBS, &m_mfxVideoParams);
...
}

0 Kudos
IDZ_A_Intel
Employee
1,510 Views
Hi,

Since I do not have insight into what your application does it's unclear what is causing the issues.

Are your threads using completely separate resources? To eliminate race conditions or resource trashing I would suggest you try to separate the resources for each decode session. However, if you would like to use Media SDK SW decode to perform parallel decode operation I also suggest you use the Media SDK Session Join feature.
Also, make sure you're not running out of memory. Decoding multiple streams (depending on the content resolution) may consume considerable amounts of memory.

Multi-threaded workloads are part of our Media SDK validation process. Just as a sanity check, I did create a threaded decode workload decoding 32 1280x1024 H264 streams in parallel. It works fine.

I suggest trying to debug your application further to explore the source of the issue.

Regards,
Petter
0 Kudos
Reply