MP4 File Writing

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message


  • Posts: 1
  • Joined: Tue Feb 19, 2013 11:00 am

MP4 File Writing

PostTue Feb 19, 2013 11:12 am


I have a question capturing the NALPackets from BlackMagic SDK and DeckLink Streaming Device to MP4 Device in C#.NET using MediaFoundation.NET. Currently, I am following the example as given in this tutorial: ... 85%29.aspx

I am not able to create a Sink Writer with pMediaTypeOut to YUY2/NV12. It is giving a COM exception (invalid Media Type). pTypeMediaTypeIn is set to H264.

And If I create a Sink Writer and set the pMediaTypeOut and pTypeMediaTypeIn to H264 after HandleStreamChange (as given in Streaming Preview C++ example), I am able to initialize the Sink Writer. Then I go through the process of creating IMFSample from NALPackets, set SampleTime, SampleDuration and use WriteSample. I am able to create the MP4 file but it is not playing with Windows Media Player/Quick Time Player.

Please help on how to register the sink writer with pMediaTypeOut to YUY2/NV12 and how to get the mp4 file to play with Windows Media Player

Thank you,

Sarah Jones

Blackmagic Design

  • Posts: 231
  • Joined: Wed Aug 22, 2012 3:45 pm

Re: MP4 File Writing

PostWed Feb 20, 2013 1:41 am

I think this question might be better answered via our developer list ... -developer
Sarah Jones

Blackmagic Design

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 2 guests