View Full Version : WavSource drops audio with large (3.5GB) wav file?
Jeff D
5th April 2004, 08:27
I've been working with a recording of the superbowl, the source recording was from a replayTV. I use DVD2AVI 1.76 to make a .d2v and save off the mpeg audio. The mpeg audio was converted to wav audio with winamp. The wav audio file is 3.54GB in size and 3.5 hours in length, this is what I'm using in my script for audio source.
the code looks something like this:
video=MPEG2Source("F:\football\superbowl.d2v")
audio = WavSource("F:\football\superbowl-109ms.wav")
daudio= DelayAudio(audio, 0.109 )
full=AudioDub(video, daudio)
About 1/2 in the 3rd quarter the audio drops out. My first thought is that some function isn't able to deal with sizes this large. But, that's just a guess. I've removed DelayAudio call and that had the same result. It looks like it's either WavSource or AudioDub that's causing my problem.
Video plays fine, but the audio just disappears.
DVD2AVI did extract the entire audio stream, and winamp did a good job with creating the wav file. The file used in the WavSource command is 5.5 hours long. FWIW, audio format is 48k 16-bit stereo.
Has anyone else encountered a problem with this?
Jeff D
6th April 2004, 08:13
It's looking like this is a 2GB issue, but I need someone to check my math.
The problem is specific to playing from the start of the file, if I open a simple avs file in vdub and skip forward I can get to 3:06:24.833 before the audio cuts out. If I skip around near this point I can get audio past this point, but I haven't truely figured if this is true.
So, my sample rate is 48KHz and 16bit stereo. Which would equal 192000 bytes per second. 3:06:24 would be 11184 seconds. 11184seconds at 192000 bytes per second is 2GB at that point, or very close to it.
Or is my math wacked?
Can anyone confirm that you can play audio past the 2GB point?
aklendathu
6th April 2004, 10:39
Jeff,
Would you like to try this ?
http://www.avisynth.org/warpenterprises/files/mpa2wav.zip
Look up http://www.avisynth.org/warpenterprises/ at the very bottom.
I've never tried it, though so I don't know how well it works (if at all).
Jeff D
6th April 2004, 20:19
aklendathu, I can try that.
I'm a fan of keeping it simple so I don't like to mess with things too much.
Jeff D
6th April 2004, 20:27
Ok, maybe that won't work.
I ran the mpa2wav on the .mpa file from dvd2avi.
mpa2wav looks like it gets all the data correct, sample size, sample rate, average bitrate, ect.
Opening the file with
audio = WavSource("F:\football\audio.mpa.wav")
ACM failed to suggest a compatible PCM format
Any suggestion (i'm off to look around)
Do I need qmpeg_mp2.zip or qmpeg.acm? I'm confused if this is needed or not. As I have other filters that can play mpeg audio.
sh0dan
6th April 2004, 21:33
ok a couple of things:
1) Try using MPASource.
2) Try using DirectShowSource.
3) I've looked through the AVI/WAV-Source, and found a few places where the problem could occur. Try this dll (http://cultact-server.novi.dk/kpo/avisynth/avisynth.dll) (Overwrite the existing one in System32). (Beware - Mostly untested). Length limit should however now be at >10 hours, which is approximately as much as AVI can handle.
Jeff D
7th April 2004, 00:11
sh0dan, thanks for the info.
Here's what's going on... That dll change didn't help. Is there a way to verify that the avisynth.dll I installed in the system32 directory is being used? I searched the system and there are several avisynth dlls the system direcotries, vdub and there were ones in a avisynth switcher directory (that's been removed).
MPASource, wow, is that slow, even the floating point version. But it still cuts out at the same point, it's almost as if it's a wrapper for the wavsource.
DirectShowSouce, I get the error it's not a function. I thought it was a built in command. I'm running 2.55.
My command:
audio = DirectShowSource ("F:\football\superbowl-109ms.wav", audio=true, video=false)
stickboy
7th April 2004, 00:30
Originally posted by Jeff D
Is there a way to verify that the avisynth.dll I installed in the system32 directory is being used?Load a script with the Version() command (or load Version.avs in the AviSynth examples folder) and check the version number and build date.
Jeff D
7th April 2004, 00:37
Originally posted by Jeff D
I'm running 2.55.
[/B]
=) Already stated that. That explains why the build date is April 6, 2004. Damn I was hoping another DLL was being used. =(
I'm still looking into directshowsource, but my tests have all failed and I can't find much documentation (other than it should work with 2.5).
esby
7th April 2004, 03:45
mmmm i'm a bit dumb here...
But what about compressing the audio separately
and adding it after...
Ok, ok, that's a workaround...
Now more seriously,
supposing it's a a 2/4 gb problem...
if you plan for mp3 / mp2 audio...
and if your encoding application support directstream copy (at least for audio, eg: virtualdub , virtualdubmod)
compresses it with your audio encoder...
try serving it as compressed... ( Cf. http://forum.doom9.org/showthread.php?s=&threadid=71482 )
For that to work, you probably need to put in comment delayAudio()
and do the delay when compressing with the codec you want to use. (trimming out it a bit here).
(and do not use directshowsource() for that method too)
esby
Jeff D
7th April 2004, 04:36
esby, same thing happens with mpeg audio.
Just to follow up on the mpasource issue...
If I trim the source to a section past the 3:06:25 part video starts to play instantly. If I trim the source that ends before 3:06:25 then there is the long delay when play starts. It seems like audio isn't getting to the filter, so would this be avisynth's issue handing the data to the filter? Or maybe some generic audio indexing problem?
Jeff D
7th April 2004, 08:19
Well, it was tough to find qmpeg.acm, but I did. Google actually lead me to it when searching for a documented problem with avisynth and file size limits on wavsource. Thanks google, it wasn't the easiest thing to find directly by name. =(
Anyway with the gmepg.acm file, and mpa2wav I was able to get the audio to play through. This was the only method that's worked so far.
Thanks everyone for all the help!
Sh0dan, if you end up looking at the source any more and want me to test anything let me know. (hey, I know, if there's a workaround... not as big an issue, not that 3GB wav files are big issues to start with.) I'll have these large files around for a few more days at least.
sh0dan
7th April 2004, 15:19
Just confirmed that the patched version didn't work. I traced the routines, and it seems to end in a VFW call. This basicly means no easy patch.
(On the good side, I got the sound generation in Colorbars optimized a bit, so I didn't have to wait 10 minutes for it to generate 4 hours of sound ;)
Jeff D
7th April 2004, 19:42
Originally posted by sh0dan
Just confirmed that the patched version didn't work. I traced the routines, and it seems to end in a VFW call. This basicly means no easy patch.
(On the good side, I got the sound generation in Colorbars optimized a bit, so I didn't have to wait 10 minutes for it to generate 4 hours of sound ;)
Thanks for the effort, guess microsoft has got ya by the balls.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.