question

wonkyumlee-9707 avatar image
0 Votes"
wonkyumlee-9707 asked AdamZofware-1744 answered

can I encode with fragmented mp4 in uwp?

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?

windows-uwp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I checked about the mediaTranscoder object, it doesn't have method that can convert video file with fragmented mp4 type. Then I searched how to convert to fragmented mp4 type, but didn't find there is any api can do this. So there should be no such method to convert.

0 Votes 0 ·

then probably, using ffmpeg or other tool might be the only way?

0 Votes 0 ·

Yes, you may need to look for tools yourself to achieve the conversion.

0 Votes 0 ·

1 Answer

AdamZofware-1744 avatar image
0 Votes"
AdamZofware-1744 answered

@wonkyumlee-9707 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!



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.