title: Calculate TS File Duration
body: <p>I am working on a media player application : Which plays ISDB-T audio and video. 
  I am using GStreamer for decoding &amp; rendering.</p>
  
  <p>For AV Sync to work perfectly, I should regulate file reads: so that data will be not be pushed to Gstreamer neither too fast nor too slow.</p>
  
  <pre><code>If I know the duration of TS file before hand, then I can regulate my reads. But how to calculate the TS file duration ?
  </code></pre>
  
  <p>Because, I need to verify the application with multiple TS files, cannot calculate the duration using some utility and keep changing the file reads - How can this be achieved in program?</p>
  
  <p>Thanks,</p>
  
  <p>Kranti</p>