question

PaweMilitowski-2843 avatar image
0 Votes"
PaweMilitowski-2843 asked PaweMilitowski-2843 edited

MediaComposition

I am using MediaComposition to scale the video. I am creating a MediaEncodingProfile:

 var mediaEncodingProfile = mediaComposition.CreateDefaultEncodingProfile();

I am creating a MediaClip and adding it to MediaComposition

 var video = await MediaClip.CreateFromFileAsync(videoFile);
 this.mediaComposition.Clips.Add(video);

And I set the height and width of the video in mediaEncodingProfile.

 mediaEncodingProfile.Video.Width = newWidth
 mediaEncodingProfile.Video.Height = newHeight

When newWidth and newHeight are larger than the height and width of the video, the colors are lighter than they should be

 mediaComposition.GenerateMediaStreamSource(this.mediaEncodingProfile)

Can I somehow turn off automatic color changing?






windows-uwp
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.

NicoZhu-MSFT avatar image
0 Votes"
NicoZhu-MSFT answered

Hello,
Welcome to Microsoft Q&A!

When newWidth and newHeight are larger than the height and width of the video, the colors are lighter than they should be

It's by default when you zoom in the original video size. such as 320*240->1280*720. Total pixels number will increase many times, but available pixels still 320*240. So the color will be light.

As you mention above, it looks like Image quality enhancer, currently, MediaComposition has not provide such api could enhance the color automatically. You may refer to custom video effect document and re-render video after above.

Thank you.



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.

PaweMilitowski-2843 avatar image
0 Votes"
PaweMilitowski-2843 answered PaweMilitowski-2843 edited

@NicoZhu-MSFT Thank you for your answer

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.