locked
Creating mp4 file with Media Foundation fails on certain machines. RRS feed

  • Question

  • I asked this question also in another forum, but maybe this is a better place because it concerns Media Foundation

    http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/259590d2-981b-479f-ab57-234a50749252

    I have a Windows Store app 'Record Voice & Pen' in which I use Media Foundation to create mp4 files. I use the function MFCreateSinkWriterFromURL to create the file and the function IMFSinkWriter.WriteSample to write audio and video data to the file. This all works fine on my DELL laptop, my Surface tablet, and what I see from the reviews also on Surface PRO tablets. So these mp4 files play well on all machines. When the app runs on an ASUS ME400C tablet, it creates an mp4 file, but the file can not be played back on that machine or on any other machine. A review from a user contains the same story without specifying the tablet on which it doesn't work.

    If I open the file in TopoEdit tool, I get the following error: Failed to create source node. The byte stream type of the given URL is unsupported.

    Does anybody know how it is possible that an app on two different machines behave differently? And how to find out what the problem is with the mp4 file created by the Asus machine? Are there tools that can help me analyzing that file?

    Just in case someone is interested. I have here a mp4 created with an Asus machine
    https://skydrive.live.com/redir?resid=9A6F31F60861DD2C!449&authkey=!AJVXFclI4BoJs0o
    and a mp4 created with my Dell laptop here
    https://skydrive.live.com/redir?resid=9A6F31F60861DD2C!450&authkey=!AKtrfkDprZyJJI0

    Regards

    Ronald

    Thursday, March 14, 2013 8:33 AM

Answers

  • Property MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS on SinkWriter was set to true. When setting it to false, the video file created on the ASUS tablet is playable.
    Monday, March 25, 2013 9:30 AM

All replies

  • Thanks for answering.

    How can you see that the Asus file has a frame rate of 0.001? When I load this file in GSPOT all the fields are empty except the container data. And MediaInfo crashes when I load the file.

    I am pretty sure that the SinkWriter.Finalize ran and succeeded, because there is a CHK statement which throws an COMException if it returns a FAIL value.


    Friday, March 15, 2013 9:15 PM
  • Property MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS on SinkWriter was set to true. When setting it to false, the video file created on the ASUS tablet is playable.
    Monday, March 25, 2013 9:30 AM