unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.17k stars 241 forks source link

Add Rotation, Width, Height, to MediaInfo #633

Open kgreen opened 1 year ago

kgreen commented 1 year ago

Issue Title (Add Rotation, Width, Height, to MediaInfo)

When attempting to get the Width and Height of a video before it is loaded, it would be nice to have those values as public properties on the MediaInfo object returned from Library.RetrieveMediaInfo. I can get PixelWidth and PixelHeight from the StreamInfo object found in MediaInfo.BestStreams, but even then if the video is portrait (rotation -90 for .mov files for instance), PixelWidth and PixelHeight do not reflect this. Rotation is not exposed and at this point I am using metadataextractor to get this information.

Issue Categories

Version Information

Expected Results

-MediaInfo will have public properties for Width, Height, and Rotation

Sample Code

--Would love something like this:

C

MediaInfo info = Library.RetrieveMediaInfo(MediaItem.FilePath);
int height = info.PixelWidth//if its a 1080 x 1920 portrait video this value would be 1920
int width = info.PixelHeight//if its a 1080 x 1920 portrait video this value would be 1080
int rotation = info.Rotation //for example -90 for a portait .mov file from an iphone