I want to make videos from images in uwp, for this i select some images and made mediaclips of it and adde to mediacompotion. When i Preview the composition in a MediaElement it sometimes gives error... it's perfectly work on windows 10 devices but not in windows 11.
The data specified for the media type is invalid, inconsistent, or not supported by this object. (Exception from HRESULT: 0xC00D36B4)
and sometimes gives error....
insufficient memory to continue the execution of the program.
public void UpdateMediaElementSource() {
mediaStreamSource = composition.GeneratePreviewMediaStreamSource(
(int)mediaPlayerElement.ActualWidth,
(int)mediaPlayerElement.ActualHeight);
mediaPlayerElement.Source = MediaSource.CreateFromMediaStreamSource(mediaStreamSource);
}
private async void MediaPlayer_MediaFailed(MediaPlayer sender, MediaPlayerFailedEventArgs args) { } sometime media not loaded properly
i follow this link for task... text
i expecting Preview the composition in a MediaElement with no any media failed error.. thanks in advanced