MFTranscodeContainerType_FMPEG4 iOS/OSX playback RRS feed

  • Question

  • Hi there, wondering if anyone can provide assistance on creating a fragmented MPEG 4 video with Media Foundation API's that can be played back on iOS devices such as iPhone or iMac with OSX. 

    Creating a IMFSinkWriter with encoding attributes of MF_TRANSCODE_CONTAINERTYPE set to MFTranscodeContainerType_MPEG4 creates a standard MP4 video no issues with playback but when I change the transcode container type to MFTranscodeContainerType_FMPEG4 then it will only playback the recording on Windows 10 (which you expect) or through VLC or some other 3rd party media players on any other OS such as OSX (iOS through infuse works as well).

    checking the media file details in mp4box for fragmented MP4 file shows 

            Computed Duration 00:00:00.000 - Indicated Duration 00:00:33.447
            Fragmented File: yes - duration 00:00:00.000

    with No sync sample found.

    a non-fragmented standard MP4 created in MediaFoundation APIs shows a computed duration correctly and lots of sync samples.

    I have tried every combonation of encoder, codec and mediatype attributes, along with using a frgmented media sink (MFCreateFMPEG4MediaSink) and all can only be played natively through windows 10.

    None of the samples created have MF_MT_MPEG_SEQUENCE_HEADER attached when using fragmented options as well so I assume that these need to be added during each WriteSample to the SinkWriter but I dont know how to calculate the SPS/PPS data required.

    I've been stuck on this for months and desperate for some help.


    Tuesday, March 12, 2019 6:57 AM