Take photo from image stream using capture engine technique in media foundation

Hi,
I am beginner for media foundation.I have to develop Win32 desktop application using capture engine technique in media foundation.
I have to implement the following features:1)Show video streaming 2)Capture video 3)Capture photo from still-image stream.These features are implemented in capture engine.
I am able to take photo from video stream not from image stream.I tried to configure the image stream index in Addstream() api,but its giving MF_CAPTURE_ENGINE_ERROR error.
To trigger the still pin,use
the IAMVideoControl::SetMode method
in directshow. How do i implement this feature using capture engine technique in MF?My question
is-is it possible do it in Media foundtion??I have searched many sites but no luck.
Here the sample code which i used to capture an image.
HRESULT TakePhoto()
HRESULT hr = m_pEngine->GetSink(MF_CAPTURE_ENGINE_SINK_TYPE_PHOTO, &pSink);
if (FAILED(hr))
goto done;
hr = pSink->QueryInterface(IID_PPV_ARGS(&pPhoto));
if (FAILED(hr))
goto done;
hr = m_pEngine->GetSource(&pSource);
if (FAILED(hr))
goto done;
hr = pSource->GetCurrentDeviceMediaType(1, &pMediaType); // 1 is Image stream index.I will get current image stream media type here.
if (FAILED(hr))
goto done;
//Configure the photo format
hr = CreatePhotoMediaType(pMediaType, &pMediaType2,GUID_ContainerFormatBmp);
if (FAILED(hr))
goto done;
hr = pPhoto->RemoveAllStreams();
if (FAILED(hr))
goto done;
DWORD dwSinkStreamIndex;
// Try to connect the first still image stream to the photo sink
if(bHasPhotoStream)
hr = pPhoto->AddStream((DWORD)MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_PHOTO, pMediaType2, NULL, &dwSinkStreamIndex); //Instead of MF_CAPTURE_ENGINE_PREFERRED_SOURCE_STREAM_FOR_PHOTO,i gave index as 1.i am getting error
if(FAILED(hr))
goto done;
hr = pPhoto->SetOutputFileName(pszFileName);
if (FAILED(hr))
goto done;
hr = m_pEngine->TakePhoto();
if (FAILED(hr))
goto done;
return hr;
HRESULT OnCaptureEvent(WPARAM wParam, LPARAM lParam)
GUID guidType;
HRESULT hrStatus;
IMFMediaEvent *pEvent = reinterpret_cast<IMFMediaEvent*>(wParam);
hr = pEvent->GetExtendedType(&guidType);
if (SUCCEEDED(hr))
if (guidType == MF_CAPTURE_ENGINE_ERROR) //i got this error if i give dwSourceStreamIndex as '1' in Addstresm api
DestroyCaptureEngine();
pEvent->Release();
return hrStatus;
Please help me to solve this problem.Past one week,I am working on this issue and i couldnt find the solution.Please give me a some idea or some sample code to solve this problem.
Thanks in advance.
Regards,
Ambika

Hi Everyone,
Any help will be appreciated.
Regards
Ambika

Similar Messages

  • Can i take photo from wireless camera using labview?

    my project is fire fighting robot it detect fire using camera so can i use wireless camera when using labview or not?and if yes, how can i do that?

    Hi khaledyr,
    yes it's possible, but the effort to realize it depends on the camera model. Do you already know the camera type you will use for it?
    Mike

  • I can take video made in Photo Booth and use in my Smilebox greetings and I can use photos from iPhoto to use there also.  I have not been able to figure out how to take clips from iMovie for that.

    For anyone who has used "Smilebox" for greeting cards:  I can take video made in Photo Booth and use in my Smilebox greetings and I can use photos from iPhoto to use there also.  I have not been able to figure out how to take clips from iMovie for use with Smilebox.

    For anyone who has used "Smilebox" for greeting cards:  I can take video made in Photo Booth and use in my Smilebox greetings and I can use photos from iPhoto to use there also.  I have not been able to figure out how to take clips from iMovie for use with Smilebox.

  • I want to take files from my PC (using a Seagate external hard drive) then plug this Seagate External hard drive into my Mac Book Pro and move the files from the Seagate External Hard drive onto my Time Capsule. I do not want to put these files on my Mac

    I want to take files from my PC (using a Seagate external hard drive) then plug this Seagate External hard drive into my Mac Book Pro and move the files from the Seagate External Hard drive onto my Time Capsule. I do not want to put these files on my Mac. How do I do this? Where do I put these files on my Time Capsule? Will it affect the functioning of my Time Capsule?

    Mixing files with data is not always great idea.
    See info here.
    Q3 http://pondini.org/TM/Time_Capsule.html
    Why not just connect the PC directly to the TC by ethernet and copy the files over?
    It is hugely faster and much less mucking around.
    In windows load the airport utility for windows.. if you have not already as this will help you access the drive.
    There is more info here.
    http://support.apple.com/kb/HT1331

  • Does anyone know how to take photos from IPHOTO into Lightroom?

    does anyone know how to take photos from IPHOTO into Lightroom?

    Because Apple has dropped "Aperture" and is switching users away from "iPhoto" to a new photo application called "Photo" so that they are more fully integrated with the Yosemite 10 and the iOS 8.3 going forward there are some instructions how to import photos into Lightroom without losing to much metadata or other information. Go under Lightroom help and follow he instructions.

  • Removing photos from air stream

    How do I remove photos from air stream?

    Follow the instructions here >  iCloud: Resetting your Photo Stream

  • IPhone 6plus camera freezes when trying to take photos from within other apps

    Hi,  8.1 6Plus,   my regular camera turns black screen when trying to take photos from within other apps or sometimes between photos in the regular camera app.  I can still take a photo, I just have no idea what I'm seeing or taking a picture of.   Then when I press retake (in other apps) the screen comes back on and it works.   Its annoying more than anything else.   Any ideas? Have done the whole close apps/restart process.
    Thanks!

    What version of iPhoto? How much disk space did you have before deleting things?
    Regards
    TD

  • How do I delete photos from my iPad using iOS 8

    how di I delete photos from my iPad using iOS 8?

    I don't know why the TV Show Tab would be unresponsive. Try force closing the Videos App, then reset the iPad and try again.
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    Something else address is why you don't see the videos in the settings, but if you can't get into the TV section of the Videos app, it really doesn't matter yet. Just to be sure, go to Settings>iTunes & App Store>Show All>Videos>OFF. Make sure that is set to OFF.

  • How do you take photos from your phone onto your computer?

    I've just gotten an iphone and am wondering how u take photos from the phone and put them on your computer. They dont seem to sync on to the computer.
    Thanks

    When I import photographs from my camera I can see the camera's card listed in the Finder. I move the files to my Mac.
    When I connect my iPhone to the Mac, it appears in iTunes, but not in the Finder. I don't know how to import the photographs. How do I do this?
    I am about to replace the iPhone (battery problem), and I don't want to lose the Camera Roll photos. I'd rather not have to email them to myself if I don't have to.
    Thanks,
    Phil

  • When does PC download the photos from a stream?

    my PC, Iphone and Ipad is set for photo stream but at what point does a pc make the decision to download photos from the stream to the pc folder?

    Thanks for your answer.
    I returned my faulty iphone 4s and I tried to restore the new with the icloud backup of the old phone. However, only a few photos were downloaded from this backup.

  • Cannot download photos from Kodak Z612 using new Photos

    I had no problem downloading photos from my Kodak Z612 camera using iPhoto. Now I cannot download anything using the new Photos or Image Capture. As in earlier posts, re. iPhoto April 2014, I get a list of the .jpg photos that I wanted to import and a message that says the files are in the wrong format. Really? .jpg is the wrong format? I tried a couple of work-arounds from April 2014, but they did not work. Does anyone have any ideas on how to download photos from my Z 612 using the new Photos?

    Thanks for the info, but I have done that before searching for answers to the problem. I, and anyone else with the same problem, should not be required to jump through extra hoops to do what we have always done with iPhoto, whether it is a Kodak or a Nikon.

  • I deleted photos from my Iphone5 using the 'internal storage' in windows with the phone plugged in. Why are all the photos still in photostream when they don't show up as a file in windows anymore?

    Hi all,
    I plugged in my phone, went to my computer, iphone, storage, and deleted photos from there. But in my phones photostream, they are still there. Why is that?
    Cheers

    Hi Isaacprobert,
    Thanks for the question. Based on what you stated, it seems like you still have photos in Photostream. I would recommend that you read this article, it may be able to help the issue.
    My Photo Stream FAQ - Apple Support
    Photos in My Photo Stream are saved on the iCloud server for 30 days.
    Thanks for using Apple Support Communities.
    Cheers,
    Mario

  • Accessing photos from hard drive using photoshop starter edition 3.2

    Hi, I have recently bought an external hard drive and have now copied all my photos from my c drive to my external hard drive. I would now like to access my photos directly from the external hard drive as well as download photos from my camera directly onto the external hard drive, can someone please help? I am currently using Adobe Photoshop Starter Edition 3.2 and running Microsoft XP. I read somewhere that I will need to change something in the Organizer, is this possible for Adobe Starter Edition 3.2?
    Thanks in advance for your help.
    Christina Fletcher

    Hi Christina,
    The only thing you will encounter in doing is you might have to repeat
    the process of bringing the images back into PSA SE because unlike the
    Elements Family, it does not have the ability to move things.
    I would suggest trying two things:
    1. Begin by moving the images and then (AFTER YOU MOVE THE IMAGES) click
    on File>Reconnect all files. The problem with this method is you have
    reconnect EACH file separately. Not a very pleasant option.
    2. (Recommended) If you are not worried about tagging as much, then
    simply click on Get Photos>From Folder and then pick the External Drive.
    It might force you to pick a certain folder, so I do recommend keeping
    them in something like My Picture Ext so that it is easier for you, but
    it will do it.
    Cheers

  • Importing RAW image edited using Capture NX

    I made some adjustments to an image using Capture NX. But when I import the modified image into Aperture all the settings are gone ... Is there anyway to preserve all these settings during import ? I read a similar post on DNG.
    http://discussions.apple.com/thread.jspa?messageID=3604267&#3604267
    Does the same apply to RAW format ?

    I made some adjustments to an image using Capture NX.
    But when I import the modified image into Aperture
    all the settings are gone ... Is there anyway to
    preserve all these settings during import ? I read a
    similar post on DNG.
    http://discussions.apple.com/thread.jspa?messageID=360
    4267&#3604267
    Does the same apply to RAW format ?
    This is correct - any editing you do in other RAW programs will not be preserved on import into Aperture, unless you export a TIFF or JPEG from the other editor and import that.
    If you export a 16-bit TIFF file, you preserve the ability for Aperture to have the full range of editing it would with a RAW.
    This is not a unique situation to Aperture; as I understand it Photoshop ACR would also not see changes you had made to a RAW file in CaptureNX.

  • Take input from table control using wizard

    Dear experts,
    I am trying to take data from table control into internal table using wizard.
    In main report program i defined the internal table and used wizard after  that.
    I could see internal table there and i picked the fields i wanted.
    Also i defined a workarea of same time.Further i made a push button.
    In PAI user command module i specified
    loop at itab. (one used for table control data)
    endloop.
    Here i put break point and find that no data is coming from grid.
    With wizard what additional i have to do ?

    Hi
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_2209.  "do processing
    loop at itab.
       module UPDATE.                           "read from tbl ctl into db table using wa.
    endloop.
    DATA:   itab TYPE TABLE OF YSTUDENT WITH HEADER LINE,
                WA LIKE LINE OF ITAB.
    MODULE UPDATE INPUT.
    WA-ID = YSTUDENT-ID.
    WA-NAME = YSTUDENT-NAME.
    INSERT YSTUDENT FROM WA.  
    ENDMODULE.
    Instead of Insert into table, you can write: APPEND WA TO ITAB.    
    Also YSTUDENT-ID is the name of the column in your tbl ctrl.
    Make sure your PBO also loops thro the itab:
    loop at itab with control tab1.
    endloop.
    Hope this helps
    Regards,
    Jayanthi.K

Maybe you are looking for

  • How to get the last value edited by users from JTable?

    Hi. I have a JDialog that includes an editable JTable. This table is used to set up field caption and font for a report program. I found only when cursor is moved to another cell, the value in current cell being edited will be transferred to Table Mo

  • How do i play swf games

    i have downloaded some swf games online and i can play them at school but i cant at home , of course the school must have the file that i am looking for  , i have downloaded shockwave player and the latest version of flash player but i still cant see

  • Mapping inside/outside BPM

    Hi All, I would like to know the flow when  mapping is inside BPM and when it is outside BPM. And also about the configuration steps in either cases. Thanks, Vishal

  • Goto command in LabVIEW

    Hi I was wondering if there's anything like a "goto" command in labview. For example, if I am in a for loop (and the for loop hasn't reached it's number of time to loop yet) and need to exit the loop and jump to somewhere else in a code because I enc

  • Supress Column headers in Crosstab on page 2+

    I have a crosstab report that spans multiple pages.  We export it to Excel for analysis, and never (or very rarely) print it.  We have to delete the column headings on page 2+ once it is in Excel.  Is there some way to supress those headers so that t