Click here to Skip to main content
14,266,113 members
Rate this:
Please Sign up or sign in to vote.
Hi,

I am beginner for media foundation.I'm using media session topology technique to show preview from USB Camera device.

I built the topology to show preview and capture video,both are working successfully

I am facing problem in saving image from image stream(still pin). I'm trying this following way to build the topology to grab a frame.

1)Shut down the topology and session.
2)Created new topology and session.
3)Activated the media source.
4)Deselected the video stream(capture pin) and selected the image stream(still pin).Added source node to topology.
5)Added sample grabber callback sink output node(Save a frame in a file)
6)Set the topology
7)Session raised MF_TOPOSTATUS_READY event. Session started to play.
8)After session started,Media session event is giving HRESULT:0X80070057(E_INVALIDARG).

I am able to get and set the still pin resolution and format.

Why i cant build the topology to grab a frame. Why this hresult is occurring for me? Am i building the topology correctly or missing something?

I referred sample code from internet,most of them are used to take photo from video stream,not from the image stream.

Please guide me,how to build the topology to capture image from still pin?

Provide me a sample code.It's more helpful for me to solve this issue.

Thanks in advance.

Regards,

Ambika
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100