can I encode with fragmented mp4 in uwp?

wonkyum lee 76 Reputation points
2020-03-16T05:05:00.433+00:00

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
    2020-04-30T21:40:14.06+00:00

    @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");  
    

    with

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

    Hope that works for you!

    No comments

0 additional answers

Sort by: Most helpful