Is there a general way to get the height and width of a video file in Java. I receive/own video files in formats such as .mov, .avi, .mpg, mp4, 3gp, and m4v and wish to display them systematically using java generated web pages. Currently, I am generating HTML 5 code where height and width are needed. Posts so far suggest using ASP.net or XUGGLER but these may be overkill for what I want to do. Any suggestions for getting these values?
1 Answers
0
votes
I did not find an easy way to extract video size but I did find an easy workaround. First I converted all my valued videos to MPEG4. It took several tries of various converters and finally I found one that worked consistently but on OS X: WinX HD Video Converter for Mac
(Space savings are huge.) Next, on a hunch I tried mapping all my videos to 70% of my screen size and results are very satisfactory. Here is a sample display page for a video.
<!DOCTYPE HTML>
<HTML><BODY><small>
</small><video width="70%" height="70%" autoplay>
<source src="A1_Howard_Show2__.mp4" type="video/mp4">
Your browser does not support the video format .mp4!
</video></body></html>