Curtis
Curtis

Reputation: 103358

Get frame width/height of an mp4 file

Is it possible to get the frame width & height of an .mp4 file using ASP.NET?

I know how I can get the width & height of an image (by using a Bitmap object), but I'm not sure whether this is possible with video formats.

I'm using JWPlayer to display uploaded videos through the web application, and I want to set the width/height as a proportion of the actual video width/height.

Upvotes: 0

Views: 2465

Answers (1)

musefan
musefan

Reputation: 48415

As I like to do things the hard way I would go for reading the file meta data to try and find the information I needed.

I think this has some info about the structure of MP4 files but not had chance to read through it: http://xhelmboyx.tripod.com/formats/mp4-layout.txt

If you are happy to use a 3rd party library then this one seems to provide the data you need and looks to work with many other file formats too: http://mediainfo.sourceforge.net/en

Hope that get you somewhere ;)

Upvotes: 2

Related Questions