There seem to be two questions. I got this working by adding the following line:
MediaEncodingProfile _MediaEncodingProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga);
And changing the following line:
TranscodeFailureReason _TranscodeFailureReason = await _MediaComposition.RenderToFileAsync(_OutputFile);
To:
TranscodeFailureReason _TranscodeFailureReason = await _MediaComposition.RenderToFileAsync(_OutputFile, MediaTrimmingPreference.Fast, _MediaEncodingProfile);
The problem is that RenderToFileAsync does not work properly when using VideoEncodingQuality.HD720p or VideoEncodingQuality.HD1080p, both of these recreate a quick sound problem. Also, using VideoEncodingQuality.Auto seems to cause the encoding to fail (although I think it is designed to use the default settings from the camera).
In addition, I posted this issue on the Microsoft Partner Community forums, and their answer was that encoding may be interrupted on certain devices, for example. in its tests, the video recorded on the Lumia 638 cannot be encoded / concatenated even on other devices, but the video from HTC 8x, Lumia 920 and Lumia 930 can be encoded on all devices even 638.
They suggested that the device problem (firmware) was not a Windows.Media.Editing API problem.
source share