Variable audio data length for a .wmv file in DirectShow

44 views Asked by At

I have a question for the guru of WMV formats. I found one WMV file that is handled differently than other WMV files in DirectShow. The length of its data packets varies. This does not affect playback, but it does affect my application. So my question: is it ok for WMV video format or this file is corrupt?

You can reproduce this situation using the following:

  1. GraphStudio - DirectShow utility.
  2. LAV filters - link
  3. That WMV file - link for downloading
  4. How to assemble a graph: enter image description here

So far, I see a solution to this issue in an additional audio filter to equalize the length of the data. But I'm afraid that it will add an extra delay in the sync of the audio and video.

Thank you.

1

There are 1 answers

1
Roman Ryltsov On

The file is fine and there is no promise or convention that audio samples have constant duration. More to that, you are checking data after decoder so that question is not even related directly to WMV/ASF format itself.

I believe that standard built-in system decoder for this audio stream (Windows Media audio decoder DMO) could package the decoded audio even differently. It is the responsibility of receiving DirectShow filter to take this irregularity into consideration. As you noticed there are no playback issues - this is because audio rednerer and other filters are prepared to accept variable length media samples.