Search code examples
.netmacosmonoresolutionmonomac

Get video resolution on Mac via .NET


I can get informations about video-files like resolution by using the Shell32.dll under windows.

Is there some way to do this (in C# - running under the mono framework) that will work on Mac?


Solution

  • Since the question is unclear to me, here are two part answer:

    1. if you want to check the resolution of your screen (desktop):
    

    Check if this is implemented: System.Windows.Forms.Screen.AllScreens.

    For now, there is some code for it but it's marked with [MonoTODO] attribute.

    AllScreens: http://msdn.microsoft.com/en-us/library/system.windows.forms.screen.allscreens.aspx

    Source for the library: http://www.java2s.com/Open-Source/CSharp/2.6.4-mono-.net-core/System.Windows.Forms/System/Windows/Forms/Screen.cs.htm

    2. if you want to check video file resolution
    

    For that, I would seek ffmpeg built for Mac and using command line parameters extract resolution information from the file.

    http://jungels.net/articles/ffmpeg-howto.html