Hi!
I am writing a web application to read in MPEG-1, MPEG-2 and MPEG-4 files. I need to know the duration of the MPEG movie from the file itself.
I know the equation: Duration = file size / bit rate X 8
I am able to read the file size from my web application. Problem is: how do I know the bit rate of the MPEG file?
I have searched on the internet and I discovered that the bit rate is in the MPEG frame header.
But how do I decode the frame header? Can anyone point me in the right direction? Any websites? books that describes the frame header so that I can read in the binary data and determine the bit rate?
Anyone has a better idea to determine the duration of the MPEG movie? I am writing the web application in JSP/JAVA.
Any help is appreciated. Thanks.
I am writing a web application to read in MPEG-1, MPEG-2 and MPEG-4 files. I need to know the duration of the MPEG movie from the file itself.
I know the equation: Duration = file size / bit rate X 8
I am able to read the file size from my web application. Problem is: how do I know the bit rate of the MPEG file?
I have searched on the internet and I discovered that the bit rate is in the MPEG frame header.
But how do I decode the frame header? Can anyone point me in the right direction? Any websites? books that describes the frame header so that I can read in the binary data and determine the bit rate?
Anyone has a better idea to determine the duration of the MPEG movie? I am writing the web application in JSP/JAVA.
Any help is appreciated. Thanks.
Comment