ffmpeginteropx / FFmpegInteropX

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

Setting Aspect Ratio #391

Closed softworkz closed 8 months ago

softworkz commented 9 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 9 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 9 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 8 months ago

Yeah, the Stretch property does it. Thanks!