View Full Version : Lost sound in AviSynth
stephen22
31st January 2013, 15:07
AviSynth doesn't seem to be able to find the sound in some DV files.
I generate avi files with Laptop svga > Startech PAL converter > Datavideo DAC (digital/analogue converter) captured with Windows Live Photo Gallery.
Files function perfectly in VirtualDub which informs me that the compression codec is Cedocida DV 0.2.3, and sound is normal. BUT...
x="C:\users\me\videos\g&h.avi"
a=avisource(x)
return a
produces an avi file with no sound. (So does directshowsource).
x="C:\users\me\videos\g&h.avi"
a=avisource(x)
b=wavsource(x)
audiodub(a,b)
produces error report "audiodub needs video and audio track"
Workaround is to use "Audio from other file" in Virtualdub, using the same avi file, but I am baffled as to why some files behave like this in Avisynth. Other files generated by my DAC work perfectly well, and I can't see any difference in the Audio information provided by VD between files that work in AviSynth and files that don't.
Anyone got any ideas?
Gavino
31st January 2013, 16:42
AviSource cannot read audio from 'Type 1' DV files - you need to use 'Type 2' files.
I am surprised that DirectShowSource does not work, however.
stephen22
31st January 2013, 17:47
Thanks for reply.
My DAC does produce type 1 DV - I remember years ago having to convert it to type 2 (?for an earlier version of VD).
But Avisynth has no difficulty with audio for previous files produced by the same device.
poisondeathray
31st January 2013, 17:53
An alternative method, if you don't want to use vdub, or convert to Type2 DV using various converters - is to use ffms2 . You need the .dll and the .avsi from the package
http://code.google.com/p/ffmpegsource/
e.g
FFMpegSource2("video.avi", atrack=-1)
AssumeFPS(30000,1001)
(I'm assuming this is NTSC DV - sometimes FFMS2 reads the timestamps slightly off, that's what the AssumeFPS is for; or you can use FPSNUM, FPSDEN in ffms2)
sneaker_ger
31st January 2013, 20:25
ffms2's fpsnum and fpsden are usually not equivalent to AssumeFPS(). (Or are they for avi sources?)
poisondeathray
31st January 2013, 20:42
ffms2's fpsnum and fpsden are usually not equivalent to AssumeFPS(). (Or are they for avi sources?)
That's true, but AVI doesn't support VFR timecodes, so the end result will be the same
sneaker_ger
31st January 2013, 20:51
I just tested it: they are not equivalent, even for avi.
poisondeathray
31st January 2013, 23:17
I just tested it: they are not equivalent, even for avi.
I tested a bunch of type 1 DV-AVI files and they were the same
Out of curiosity, what was the difference ?
If there is a difference, I think AssumeFPS() would be more correct
stephen22
1st February 2013, 22:54
An alternative method is to use ffms2
I already have this magnificent dll. I tried it and it will load the rogue files with sound. But when I play the avs file VD works at first, then gives an "Access violation" report the 2nd or 3rd time I press the Play button.
In fact I have discovered that only files captured with Windows Live Photo Gallery have this problem (sound not found by aviSynth). Files captured with VirtualDub have normal sound. (All my captured video is from the same source - Datavideo DAC 100). Unfortunately VD is not up to the task, especially with long files - it drops lots of frames.
Does anyone have experience of capturing from Photogallery? I can't find any means of influencing sound capture with this program.
sneaker_ger
2nd February 2013, 00:20
I tested a bunch of type 1 DV-AVI files and they were the same
Out of curiosity, what was the difference ?
If there is a difference, I think AssumeFPS() would be more correct
I assume it does the same as it does to VFR files: drop or duplicate frames to achieve the target fps (and tell set the fps values of AviSynth accordingly) . Maybe it does not make a difference for very small disparities where no frame drops/duplications are required during the length of a file, so that it is equivalent to assumefps() for such a corner case.
poisondeathray
2nd February 2013, 00:27
I assume it does the same as it does to VFR files: drop or duplicate frames to achieve the target fps (and tell set the fps values of AviSynth accordingly) . Maybe it does not make a difference for very small disparities where no frame drops/duplications are required during the length of a file, so that it is equivalent to assumefps() for such a corner case.
I think you're right, that's what the documentation says as well
The files I tested probably weren't long enough, and the fps deviation was only off by a tiny bit, about 0.001fps .
I already have this magnificent dll. I tried it and it will load the rogue files with sound. But when I play the avs file VD works at first, then gives an "Access violation" report the 2nd or 3rd time I press the Play button.
If it's not the audio causing the problem, you can try
vid=AVISource()
aud=FFAudioSource()
AudioDub(vid,aud)
stephen22
3rd February 2013, 12:43
vid=AVISource()
aud=FFAudioSource()
AudioDub(vid,aud)
Nice idea
Doesn't work
Thanks anyway
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.