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.

How to copy data from webcam to gpu?

QS
Beginner
549 Views

Current on windows, I read webcam data through directshow into system memory, then copy then data to video memory, and then use intel media sdk for encoding.

The data pipeline is: webcam -> sys mem -> gpu mem

Because system memory data copy cost many cpu time, how to copy data from webcam to gpu? (Maybe it called zero copy)

The pipeline may like: webcam -> gpu mem

0 Kudos
4 Replies
Mark_L_Intel1
Moderator
549 Views

Hi QS,

Sorry for the late response, if somehow you can make the webcam writes its output frame to video memory directly, then you could avoid copying.

One thing I want to clarify since your pipe line description seems imply to copy system memory to video memory: you can put system memory as the direct input to Media SDK, the copying will be handled automatically inside the MSDK component, you don't have to copy it. 

Mark

0 Kudos
QS
Beginner
549 Views

Hi Mark,

Thanks for replay.

I want to know how to make the webcam writes its output frame to video memory directly?

Well,  using system memory as input of Meida SDK still will cost cpu time when doing the memory through system memory.

Any ideas to avoid using system memory?

0 Kudos
Mark_L_Intel1
Moderator
549 Views

Hi QS,

I hope there should be a good hardware design can combine the camera memory and video memory, as I remembered, Linux might have a solution with V4l2 but I am not sure if that surface can be supported by MSDK

Answer to this solution is out of the scope of Media SDK, I was just clarify how Media SDK could handle the input surface.

Mark

0 Kudos
QS
Beginner
549 Views

Hi Mark,

I know, the implementation may depends on the OS, I'm going to search something about how to combine V4L2 and Media SDK.

0 Kudos
Reply