Log in

View Full Version : Isd there a time Limit on audio tracks from long capture?


DrNick2
11th March 2008, 00:05
I have a Hauppuage Win TV Nova S2 Satellite card and a few months ago I recorded the whole 5 episodes of 'Mountains' which were shown back to back, in 1080i H.264 (1440x1080 pixels) with a 48kHz uncompressed PCM audio track, for a grand total of 4 hours 58 mins and 2s and 36,572,295 KB. I wish to edit this to create individual episodes and scale down to 1280x720.

I have used DG Index 1.5 to open the file and index it, which also creates a 558,827KB mp2 file with the audio in. I can play this and have checked it has the whole stream, and is the right length.

I tried using the following script, which I open in VirtualDub, select the frames I want and then recompress

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Dgavcdecode\DGAVCDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource\mpasource.dll")
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif\yadif.dll")

video = AVCSource("Mountains.dga")
audio = MPASource("Mountains PID 052 L2 2ch 48 256.mp2", normalize=false)

AudioDub(video, audio)

yadif()
BilinearResize(1280, 720)

This opens fine, but in File information (shown in File Ino 1.png below), the length of the audio track is given as only 1 hr 51.47, and it does indeed cut out after this exact point.

Converting the mp2 file to WAV (using Winamp) and using the following script

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Dgavcdecode\DGAVCDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mpasource\mpasource.dll")
Load_Stdcall_plugin("C:\Program Files\AviSynth 2.5\plugins\yadif\yadif.dll")

video = AVCSource("Mountains.dga")
audio = WAVSource("Mountains PID 052 L2 2ch 48 256.wav")

AudioDub(video, audio)

yadif()
BilinearResize(1280, 720)

seemed to work at first, but the audio then cuts out at 3 hours and 6 minutes, roughly at frame 280,000. I can play both the original recording, the mp2 file and the final .wav file in many applications and none of them cut out or drop out at the points in question.


I'm now just opening the .wav file in virtualdub and not giving an audio stream in avisynth, but I would like to resolve the bug out of interest.

Any thoughts?

Thanks to all whose previous posts have helped me to pick up so much from this forum by the way, I'm a long time lurker, but this is my first post.

Nick.

tebasuna51
11th March 2008, 03:01
... a 48kHz uncompressed PCM audio track, for a grand total of 4 hours 58 mins and 2s
...
This opens fine, but in File information the length of the audio track is given as only 1 hr 51.47, and it does indeed cut out after this exact point.
...
seemed to work at first, but the audio then cuts out at 3 hours and 6 minutes

You have an audio track of 4h 58m and sometimes you read 1h 52m and others 3h 6m. What happens?

Is the 4 GB limit of wav files reached at 3h 6m for a stereo 48 KHz 32 bits (MPASource output) wav file.

If the wav file have 6.4 GB you have the full track 4:58:02 but the byte length is represented by a 4 bytes value, some soft stop at max value 2^32 (4GB) -> 3h 6m, other soft ignore the limit but clip (overflow) the value and show 4:58 - 3:06 = 1:52

You can use a ConvertAudioTo16bit() to obtain a small wav file, now the limit is 6:12:49, or you can trim to individual episodes from the original mpa file.

IanB
11th March 2008, 04:31
3hours 6minutes 24.8seconds is one of the magic 2^31 limits.

Not sure about the 1 hr 51.47, it may be a bug in MPASource.

Use the the range feature, '[' and ']', in DGIndex to segment your processing into manageable chunks.

tebasuna51
11th March 2008, 09:44
...
Not sure about the 1 hr 51.47, it may be a bug in MPASource.
...

I suppose the File Information is from VirtualDub (I can't see yet the .png's) and I think is a VirtualDub/AviSynth bug because MPASource seems work fine. From mpasource.cpp (20040109):

VideoInfo vi;
...
__int64 byte_total; //output PCM bytes
...
byte_total = byte_total + size; // for each frame
...
vi.num_audio_samples = byte_total / (audiobytes*channels);

DrNick2
11th March 2008, 14:42
Thanks very much tebasuna51 and IanB, I think you have shown me why this is happening.

I was afraid someone would tell me that they wanted to see the original files, which would not have been very easy!

All the best,

Nick.