Instead of solving this problem on the server, you can solve it on the client while viewing using the HTML5 video element.
$("#video").bind("loadedmetadata", function () { var width = this.videoWidth; var height = this.videoHeight;
Using this approach, your download solution may remain untouched.
If sizing in the database is a requirement, consider how to find a way to use the video element during the download process. One approach would be to immediately show a video preview immediately after downloading, which would extract the dimensions with the JavaScript code above and place them as hidden form elements on your server.
Shawn source share