can I encode with fragmented mp4 in uwp?

wonkyum lee 21 Reputation points

After capturing screen, I am recording video as normal MP4 file with use of mediatranscoder. Is there any way to save video file with fragmented mp4 type in UWP?

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Adam Zofware 76 Reputation points

    @wonkyum lee I've been able to create fragmented mp4 files with MediaCapture by changing the container subtype. Perhaps you can do the same with MediaTranscoder. Try something like this:

    // taken from C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Mfidl.idl  
    static readonly Guid MFTranscodeContainerType_MPEG4 = new Guid("DC6CD05D-B9D0-40ef-BD35-FA622C1AB28A");  
    static readonly Guid MFTranscodeContainerType_FMPEG4 = new Guid("9ba876f1-419f-4b77-a1e0-35959d9d4004");  


    var encodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.HD1080p);  
    encodingProfile.Container.Subtype = MFTranscodeContainerType_FMPEG4.ToString("D");  

    Hope that works for you!

    0 comments No comments

0 additional answers

Sort by: Most helpful