title: Video file time length in minute while uploading to server in Spring or J2EE
body: <p>I want to save time length of the video files having several extension(mp4, wav, flv etc) in to database while uploading to server when submitting the page. But I did not find the how to get the length of the uploading video? I tried this code but it only works for audio files.</p>
  
  <pre><code>      File f = new File(fileName);
        Bitstream m_bitstream = new Bitstream(inputStream);
        Header m_header = m_bitstream.readFrame();
        int mediaLength = (int)f.length();
        int nTotalMS = 0;
        if (mediaLength != AudioSystem.NOT_SPECIFIED) {
           nTotalMS = Math.round(m_header.total_ms(mediaLength));
        }
  </code></pre>
  
  <p>Can you please help me?</p>