Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
How To Get Audio Frames From A Big Avi File(>2gb)?
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
toomore
  Posted: Dec 18 2002, 06:00 PM


Unregistered









I've I couldn't get the correct audio frame count of a AVI file by use its StreamInfo structure. So I try to use the AVIStreamRead API to test the audio frame count repeatly. It works well when I read some avi file which less than 2GB, but when I use it to analyse a big avi file(8.2GB), the API return an error. These're my code:
LONG hr;
int StartSample;
int EndSample;
int i;
int AudioFrameCount = 0;
LONG ActualBytes;
LONG ActualSamples;

StartSample = AVIStreamStart(pAVIStream);
EndSample = AVIStreamEnd(pAVIStream);

for (i = StartSample; i < EndSample; i += ActualSamples)
{
hr = AVIStreamRead(pAVIStream, StartSample, AVISTREAMREAD_CONVENIENT,
NULL, 0, &ActualBytes, &ActualSamples);
if (0 != hr)
{
//some error processing
}
else
++AudioFrameCount;
}

I've read the VirtualDub Source, but I can't understand the source. It's seems use some low-level file I/O API to read the data of a AVI file, not Microsoft's AVI API. Should I do the same thing?
Thanks.
 
  Top
fccHandler
Posted: Dec 18 2002, 06:31 PM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



Hello.

Microsoft's AVI API freaks out with files larger than 2GB. (I wouldn't call it a bug, though, since no AVI 1.0 file should ever be that big.) You could try using VirtualDub to save a segmented AVI (each segment < 2GB) and then I guess you could use the API to parse the segments.

Other than that, you'll have to write your own parser. wacko.gif

--------------------
May the FOURCC be with you...
 
     Top
muf
Posted: Dec 20 2002, 05:38 PM


MCF team member


Group: Moderators
Posts: 179
Member No.: 46
Joined: 21-July 02



QUOTE (fccHandler @ Dec 18 2002, 12:31 PM)
Hello.

Microsoft's AVI API freaks out with files larger than 2GB. (I wouldn't call it a bug, though, since no AVI 1.0 file should ever be that big.) You could try using VirtualDub to save a segmented AVI (each segment < 2GB) and then I guess you could use the API to parse the segments.

Other than that, you'll have to write your own parser. wacko.gif

OpenDML and a non-FAT (NTFS, ext2, etc) filesystem should be able to become over 4 GB.

--------------------
user posted image
 
     Top
fccHandler
Posted: Dec 20 2002, 07:03 PM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



@muf: I assume the file is OpenDML since he says it's 8.2GB. Can the Windows API parse OpenDML?

--------------------
May the FOURCC be with you...
 
     Top
muf
Posted: Dec 20 2002, 07:27 PM


MCF team member


Group: Moderators
Posts: 179
Member No.: 46
Joined: 21-July 02



QUOTE (fccHandler @ Dec 20 2002, 01:03 PM)
@muf: I assume the file is OpenDML since he says it's 8.2GB. Can the Windows API parse OpenDML?

If it wouldn't, the purpose of OpenDML would be quite useless. Btw, OpenDML is quite old. I wouldn't know why win98 and up wouldn't support it.

--------------------
user posted image
 
     Top
phaeron
Posted: Dec 20 2002, 10:26 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



DirectShow can parse OpenDML hierarchical indexing information, but AVIFile, which you are using, cannot. Microsoft hasn't done anything to VFW for a long time except port it to Win64.
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
5 replies since Dec 18 2002, 06:00 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum