Wait for a long time when seeking a new file written by IMFSinkWriter. RRS feed

  • Question

  • Hi. I want to use an IMFSourceReader to read samples from the source file and then write to a new file through IMFSinkWriter. The trouble is: if I specify a URL with no byte stream while creating the IMFSinkWriter by MFCreateSinkWriterFromURL(), seeking the target video file will be OK; but if I get the byte stream by MFCreateFile() and then specify both a URL and the byte stream while invoking the MFCreateSinkWriterFromURL(), it will wait for a long time when seeking the target video file to a new position.

    Do I forget somthing when I create the Sink Writer? Please help.

    Thursday, January 10, 2013 10:14 AM

All replies

  • Hi,

    Are you using html5/javascript to develop the app? Then you are writing that in a component? Please post more details.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Song Tian Wednesday, January 16, 2013 9:33 AM
    • Unmarked as answer by AragornZhang Wednesday, January 23, 2013 3:00 AM
    Friday, January 11, 2013 7:50 AM
  • Hi,

    Yes, I'm writing such a component which serves a windows store app.

    1. I want to create the IMFSinkWriter by URL like this: MFCreateSinkWriterFromURL(targetFileURL, NULL, pConfigAttrs, &pSinkWriter);

    This calling should create the target file specified by targetFileURL at the same time. But in a windows store app, the return value indicates ACCESS_DENIED.

    2. As a result, I changed the way. I create the target file firstly and then retrieve an IMFByteStream associated with it pointed by pTargetStream. After that, I create the IMFSinkWriter by stream like this: MFCreateSinkWriterFromURL(targetFileURL, pTargetStream, pConfigAttrs, &pSinkWriter);

    This calling succeed. So I can write samples into the target file by function IMFSinkWriter::WriteSample(). However, when I was seeking forward/backward the video while playing, it would wait for a long time before continue playing.

    3. I test these two ways of creating IMFSinkWriter in a desktop app. The result is the same. The seeking will stuck if create the IMFSinkWriter by stream. If creating by URL, the seeking will be OK.

    So, my question is: What is the difference between these two ways of creating IMFSinkWriter? Do I forget something to initialize? Is there any sample code or document should I read?

    Thank you very much.

    Wednesday, January 23, 2013 2:59 AM