H.264v 3GP file output to memory other than a file RRS feed

  • Question

  • Hello all,

    I'm working on a project where I need to capture video from webcam and save as an H.264 3GP file, but I have to save exactly the same data directly into memory instead of file in disk, means if I write the data into disk, the file should be exactly the same with the original file.


    I use the sample code "MFCaptureToFile" , I pass a file name with ".3gp" file name extension and set ENCODING_TYPE_FORMAT to MFVideoFormat_H264.


    In function "StartCapture", the code uses "MFCreateSinkWriterFromURL" to create sink writer, in MSDN, it says if the second parameter "IMFByteStream *pByteStream" is a valid IMFByteStream pointer, MFCreateSinkWriterFromURL will write all data into IMFByteStream, the URL provided in pwszOutputURL is informational only.


    I define a IMFByteStream pointer, and pass it into MFCreateSinkWriterFromURL, but MFCreateSinkWriterFromURL still write data into file, I try not pass pwszOutputURL and use read function of IMFByteStream, and then I got error in my program, seems like I access illegal memory.


    I don't know what happen, could someone teach me how to write data into memory by using MFCreateSinkWriterFromURL? I already troubled by this problem for almost a week.

    Forgive my poor English


    Thanks for your help.

    Best regards,

    • Edited by Eason Cheng Friday, December 2, 2011 9:37 AM
    Friday, December 2, 2011 9:36 AM

All replies

  • Hi Eason !

    I working on the same think : getting output data into buffer rather to a file, to send it on network.

    Do you have find any solution ?


    I will look about that on next few days.


    Forgive my poor english too !!


    Tuesday, January 3, 2012 10:50 AM