Community
cancel
Showing results for 
Search instead for 
Did you mean: 
QS
Beginner
120 Views

How to copy data from webcam to gpu?

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
120 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

QS
Beginner
120 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?

Mark_L_Intel1
Moderator
120 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

QS
Beginner
120 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.

Reply