View Full Version : AVISource truncate of long PCM audio
belonesox
2nd August 2013, 11:21
Hello.
Have a lot of long videos, like
Input #0, avi, from '2013-06-15-10-50-32.avi':
Metadata:
encoder : Lavf54.29.104
Duration: 09:25:16.52, start: 0.000000, bitrate: 30314 kb/s
Stream #0:0: Video: dvvideo (dvsd / 0x64737664), yuv411p, 720x480 [SAR 32:27 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
But when I open the file with AVISource
audio (not video) truncated to ≈3h 12m (http://imgur.com/udhtyNZ)
Such problem I have with all such long dvvideo AVI.
How this can be fixed?
Now I use long workaround with exporting WAVE64 by ffmpeg, but I hope, that may be this bug can be fixed of hacked without it.
Guest
2nd August 2013, 13:31
Have you tried DirectShowSource() instead of AVISource()?
foxyshadis
2nd August 2013, 22:37
I think Avisynth 2.6 fixed that bug.
belonesox
4th August 2013, 18:03
I think Avisynth 2.6 fixed that bug.
AVISynth 2.6. Proofshot (http://imgur.com/AV8d2ib).
Have you tried DirectShowSource() instead of AVISource()?
Yes. I did not like DirectShowSource because a lot of issues with video,
but It also have troubles with this audio in this long videos, for example
it makes duration of audio 49 hours instead of 10 (http://imgur.com/iZpB02U).
Wilbert
4th August 2013, 18:53
AVISynth 2.6. Proofshot.
Try the latest alpha (should be from 2013).
belonesox
5th August 2013, 22:44
Try the latest alpha (should be from 2013).
Same problem.
http://wiki.4intra.net/images/thumb/4/43/AVISynth_has_problem_opening_long_DV_files.png/458px-AVISynth_has_problem_opening_long_DV_files.png
For brave developer how can build/debug AVISynth, and have 120GB on HDD, there are 120GB torrent with this 9h DV file (magnet:?xt=urn:btih:011E9F071D68E03C53A0AA6823E902EA2E788073&dn=2013-06-15-10-50-32.avi&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%3a80%2fannounce)
I try to make smaller samplefile, but failed — the bug appears only on DV files longer 8hours..
IanB
6th August 2013, 04:01
AviSource() was implemented using the AVIFileReader code from VirtualDub. That code has 32 bit size limits on both the stream byte position and the stream sample number.
So the absolute sample count limit is 4,294,967,295 which for 48000Hz is 24:51:18.485.
The byte position limit is also 4,294,967,295, which for uncompressed 16bit, stereo, 4800Hz is 6:12:49.621
Values that exceed these limits are used modulo 2^32 (4,294,967,296).
Undoing the modulo byte position limit, (554,225,724*4 + 4,294,967,296)/4 = 6,511,870,192 -> 9:25:15.99 which approximately match the video stream length.
It seems that the VirtualDub 1.9.9 code is still 32bit limited.
Use DirectShowSource(..., video=false) to read the audio stream from such huge files.
belonesox
7th August 2013, 07:30
Thank you.
It seems that the VirtualDub 1.9.9 code is still 32bit limited.
But VirtualDub 1.9.9. works OK with this file…
Can export all audio ("Export WAV") from it.
Use DirectShowSource(..., video=false) to read the audio stream from such huge files.
DirectShowSource also results incorrect duration.
(22hrs instead of 9h)
test_dshow.avs
DirectShowSource("2013-06-15-10-50-32.avi", video=false)
ffmpeg -i test_dshow.avs
Input #0, avisynth, from 'test_dshow.avs':
Duration: 00:00:00.00, start: 0.000000, bitrate: 1482 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
but
ffmpeg -i test_dshow.avs -f w64 test_dshow.avs.wav
…
ffmpeg -i test_dshow.avs.wav
Input #0, w64, from 'test_dshow.avs.wav':
Duration: 21:50:55.23, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.