There are several ways to do this, but without a library that will work with C # for any / all .mp4 video files. It's nothing that is 100% more reliable.
Both command line options (in a way). Basically, what you will do is start the process from your ASP.NET application using System.Diagnostics.Process.
Of these, ffmpeg should be used. With ffmpeg, if you just pass the file to it (as a command line argument, if different file metadata is returned. This information can be analyzed to extract the dimensions.
Another is to use MediaInfo . This is a great tool for this. But again, you have to use the command line version (CLI version) and pretty much give it the file name as a command line argument. It has otion to create and xml response, so you can easily analyze this and other information if you can provide.
ffmpeg can also transcode your video. Although I do not see the transcoding point with mp4. Flv?
source share