ffmpeginteropx / FFmpegInteropX

FFmpeg decoding library for Windows 10 UWP and WinUI 3 Apps
Apache License 2.0
211 stars 53 forks source link

Setting Aspect Ratio #391

Closed softworkz closed 10 months ago

softworkz commented 11 months ago

Is there some way to set the aspect ratio for displaying?

I don't mean to a affect the video's aspect ratio, it's just about the presentation, i.e. letterboxed, fill width, fill height, cover - or whatever it's called in different implementations..

brabebhin commented 11 months ago

Try https://learn.microsoft.com/en-us/uwp/api/windows.media.playback.mediaplaybacksession.normalizedsourcerect?view=winrt-22621#windows-media-playback-mediaplaybacksession-normalizedsourcerect

lukasf commented 11 months ago

MediaTransportControls has a Zoom button, which can be enabled via properties. I think what it does internally is set the Stretch property of MediaPlayerElement, which you could also set manually, in case you roll your own TransportControls.

softworkz commented 10 months ago

Yeah, the Stretch property does it. Thanks!