View Full Version : Audio is silent
george84
11th November 2012, 19:06
There is a strange problem with some mp3 files.
I basically do:
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1962-1966 CD1/The Beatles - 1962-1966 CD1 - 01 - Love Me Do.mp3")
audiotrack = audiotrack + x.killvideo().eqaudio()
.
function eqaudio(clip eqaud) {
eqaud = eqaud.HasAudio() ? eqaud : audiodub(eqaud,BlankClip(eqaud.framecount, fps = VideoFPS, audio_rate=48000))
eqaud = HasMono(eqaud) ? MergeChannels(eqaud.GetChannel(1), eqaud.GetChannel(1)) : eqaud
return eqaud.ResampleAudio(48000)
}
.
above code is repeated to join many mp3s. At the end I Dub with a video.
music = AudioDub(am, audiotrack)
If I play the result in VDub then I sometimes get sound sometimes not. Video is always correct. Same problem occurs with RipBot264.
I suspect that the bitrate of mp3 is the cause. When all my mp3 have 128kbps then I hear music, when they have 192kbps there is silence. In both cases VDub displays Audiodub in progress.
Is this problem related to speed of my computer?
Is there an alternative to NicMPG123Source ? I tried also MPAsource, but this is even worse, when I hear something then it is too slow.
Is there a way around?
poisondeathray
11th November 2012, 19:20
Other options for source filters: FFAudioSource(), BassAudioSource()
http://code.google.com/p/ffmpegsource/
george84
11th November 2012, 21:10
Other options for source filters: FFAudioSource()
I just tried this. It gave me error "no audio track" on one file. After correcting this file with foobar2000 (rewrite MP3header) FFAudioSource doesn't complain anymore, but still no sound.
I also tried BassAudioSource, but no success.
Some more info:
The sequence of 192kbps mp3s gives no sound. An avs with the first song alone gives sound.
If I make a sequence where the first file has 128kbps and the others have 192kbps then there is no sound.
Saving as WAV in VDub gives a file of only 8kb.
As a last step I modified the framerate. Originally I had 24fps, changing this to 10fps gives me sound. I can go up to 23fps, but 23.5 fps doesn't work. So there really seems to be a performance problem.
I consider this a AVISynth Bug. Any ideas?
StainlessS
12th November 2012, 04:41
Find two files that fail.
Inline the script function for those two files, and find point of failure.
You have to break it down to make debugging easier.
And, this line is a little strange:
eqaud = eqaud.HasAudio() ? eqaud : audiodub(eqaud,BlankClip(eqaud.framecount, fps = VideoFPS, audio_rate=48000))
AudioDub (video_clip, audio_clip)
AudioDub takes the video stream from the first argument and the audio stream from the second argument and combines them into a single clip.
If either track isn't available, it tries it the other way around, and if that doesn't work it returns an error.
So it will be trying other way around.
Also if has no audio then eqaud will return a clip of zero frames (having killed video in main script) and silent audio of zero length,
check intent, seems an elaborate way of doing that.
EDIT:
"eqaud.framecount".
And also suggest the use of "++" instead of "+" ie Aligned Splice, nearly always what is required (does not really matter here though).
GScript and RT_Stats RT_Debug could be helpful to output realtime debugging to DebugView (you can forget about adding
final video and just return eg a dummy colorbars at the end).
An avs with the first song alone gives sound.
That would seem to discount a problem in source filter.
EDIT: Post FULL FAILING script but using only two source files, including the mysterious HasMono().
You might also try deleting any existing d2a files before trying again, just in case of problem with them.
george84
12th November 2012, 08:37
My original avs has over 16000 lines, because it is automatically generated. I eliminated the calls to eqaudio and took the effort to reproduce the error with following script:
# Modified Script originally generated by DVD slideshow GUI
#file:///C:/Dokumente%20und%20Einstellungen/Kevin/Eigene%20Dateien/SMIL/BSG21/SMILToAVS.xsl
SetMemoryMax(Round(SetMemoryMax(0)*1.0))
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Transitions\TransAll.dll")
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\vsfilter.dll" )
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\zoom.dll")
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\freeframe.dll")
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\FFmpegSource\ffms2.dll")
loadplugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\NicAudio.dll" )
#LoadPlugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\mpasource.dll")
#LoadPlugin("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\Bin\BassAudio.dll")
import("C:/Dokumente und Einstellungen/Kevin/Eigene Dateien/SMIL/BSG21/DSGcopy\FFmpegSource\FFMS2.avs")
global VideoFPS = 24
global VideoLength = 50000 #40000 is OK, 50000 gives silent audio
SMILrootlayout_width = 720#
SMILrootlayout_height = 404
# resizing background to width and height
SMILrootlayout_bgc = $000000#
SMILrootlayout = BlankClip(length = VideoLength, fps = VideoFPS, width = SMILrootlayout_width, height = SMILrootlayout_height, color = SMILrootlayout_bgc).ConvertToYV12(matrix = "REC709").KillAudio()
SMILCover_left = 210#
SMILCover_width = 300#
SMILCover_top = 64#
SMILCover_height = 300#
SMILCover_bgc = $808080#
SMILCover_bgo = 1#
SMILCover_Nframes = 0
# resizing background to width and height
SMILCover = BlankClip(length = 0, fps = VideoFPS, width = SMILCover_width, height = SMILCover_height, color = SMILCover_bgc).ConvertToYV12(matrix = "REC709").KillAudio()
#SMILrootlayout = Lanczos4Resize(ImageSource(SMILrootlayout_backgroundImage,1,1,VideoFPS,pixel_type="RGB32"), SMILrootlayout_width, SMILrootlayout_height).ConvertToYV12(matrix = "REC709").KillAudio()
audiotrack = BlankClip(length = 1, fps = VideoFPS, audio_rate = 48000, channels = 2).KillVideo().SSRC(48000)
x = ImageSource("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg", 0, 0, fps=VideoFPS, use_DevIL = true, info=false, pixel_type = "RGB32")
AVSimage_SMILCover_d1e21_mo = x.Crop(0, 0, -(x.width%2), -(x.height%2)).ConvertToYV12(matrix = "REC709").Lanczos4Resize(SMILCover_width,SMILCover_height)
###img (id:region:dur:src:transIn:panZoom:fit:mediaAlign): (d1e138:SMILCover:1.0s:file:///G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg:::meet:)
SMILCover = SMILCover + AVSimage_SMILCover_d1e21_mo
SMILCover = loop(SMILCover,VideoLength)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 01 - I Saw Her Standing There.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 02 - Misery.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 03 - Anna (Go to Him).mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 04 - Chains.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 05 - Boys.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 06 - Ask Me Why.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 07 - Please Please Me.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 08 - Love Me Do.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 09 - P.S. I Love You.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 10 - Baby It's You.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 11 - Do You Want to Know a Secret.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 12 - A Taste of Honey.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 13 - There's a Place.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
x = NicMPG123Source("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/The Beatles - Please Please Me - 14 - Twist and Shout.mp3")
#audiotrack = audiotrack ++ x.killvideo().eqaudio()
audiotrack = audiotrack ++ x.killvideo().SSRC(48000)
am = SMILCover
am = loop(am, Int(25*(audiotrack.AudioLengthF/audiotrack.AudioRate)))
music = AudioDub(am, audiotrack)
musicbite = Trim(music, 0, SMILCover.framecount)
SMILrootlayout = Overlay(SMILrootlayout, SMILCover, x = SMILCover_left, y = SMILCover_top, pc_range = false)
SMILrootlayout = AudioDub(SMILrootlayout, musicbite)
SMILrootlayout = SMILrootlayout.ConvertToRGB32(matrix = "REC709")
#
SMILrootlayout
The referenced mp3s have 192kbps. The script has two crucial parameters VideoFPS and VideoLength. Depending on the combination of these 2 parameters audio is silent or not. The combination 24/50000 gives silence, 24/40000 is OK.
The mp3s giving problems are encoded as Mode: Joint stereo.
george84
12th November 2012, 11:30
There is a fatal error where I loop to much at end of script.
Thanks for all advice.
StainlessS
12th November 2012, 11:59
Dont like
x = ImageSource("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg", 0, 0, fps=VideoFPS, use_DevIL = true, info=false, pixel_type = "RGB32")
AVSimage_SMILCover_d1e21_mo = x.Crop(0, 0, -(x.width%2), -(x.height%2)).ConvertToYV12(matrix = "REC709").Lanczos4Resize(SMILCover_width,SMILCover_height)
###img (id:region:dur:src:transIn:panZoom:fit:mediaAlign): (d1e138:SMILCover:1.0s:file:///G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg:::meet:)
SMILCover = SMILCover + AVSimage_SMILCover_d1e21_mo
SMILCover = loop(SMILCover,VideoLength)
:::
:::
:::
# SMILCover is len VideoLength Video frames of VideoFPS with zero len audio
# audiotrack is 1 second of 48khz silent Audio without Video at VideoFPS, + input mp3 audio's
am = SMILCover
am = loop(am, Int(25*(audiotrack.AudioLengthF/audiotrack.AudioRate))) # ????
# am = SMILCover [len VideoLength Video @ VideoFPS] looped Int(25*(audiotrack.AudioLengthF/audiotrack.AudioRate)) times ????
music = AudioDub(am, audiotrack)
musicbite = Trim(music, 0, SMILCover.framecount)
SMILrootlayout = Overlay(SMILrootlayout, SMILCover, x = SMILCover_left, y = SMILCover_top, pc_range = false)
SMILrootlayout = AudioDub(SMILrootlayout, musicbite)
SMILrootlayout = SMILrootlayout.ConvertToRGB32(matrix = "REC709")
#
SMILrootlayout
Suggest
x = ImageSource("G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg", 0, 0, fps=VideoFPS, use_DevIL = true, info=false, pixel_type = "RGB32")
AVSimage_SMILCover_d1e21_mo = x.Crop(0, 0, -(x.width%2), -(x.height%2)).ConvertToYV12(matrix = "REC709").Lanczos4Resize(SMILCover_width,SMILCover_height)
###img (id:region:dur:src:transIn:panZoom:fit:mediaAlign): (d1e138:SMILCover:1.0s:file:///G:/Audio/Rock Artists/B/Beatles/1963 Please Please Me/Please Please Me.jpg:::meet:)
SMILCover = SMILCover + AVSimage_SMILCover_d1e21_mo
#SMILCover = loop(SMILCover,VideoLength) # SUGGEST DELETE THIS LINE leaving it as 1 frame only
::::::
::::::
::::::
VideoLength = Int(VideoFPS *(audiotrack.AudioLengthF/audiotrack.AudioRate) + 0.5)
SMILrootlayout = Overlay(SMILrootlayout, SMILCover, x = SMILCover_left, y = SMILCover_top, pc_range = false)
SMILrootlayout = AudioDub(Loop(SMILrootlayout,VideoLength), audiotrack).Trim(0,VideoLength-1))
SMILrootlayout = SMILrootlayout.ConvertToRGB32(matrix = "REC709")
#
SMILrootlayout
It's my guess that the line marked "????" causes overflow when VideoLength == 50000 due to integer overflow. (Already 50,000 long and you loop it 25 * length in seconds of Audio)
EDIT:
Solved
There is a fatal error where I loop to much at end of script.
Just beat me :)
george84
12th November 2012, 12:47
It's my guess that the line marked "????" causes overflow when VideoLength == 50000 due to integer overflow. (Already 50,000 long and you loop it 25 * length in seconds of Audio)
Yes, that was very silly. It took me 2 days to find out, you were faster. Still strange that sometimes it worked for files having 100000 frames
Gavino
12th November 2012, 15:07
Still strange that sometimes it worked for files having 100000 frames
The reason for that is that in the offending code:
am = SMILCover
am = loop(am, Int(25*(audiotrack.AudioLengthF/audiotrack.AudioRate)))
music = AudioDub(am, audiotrack)
musicbite = Trim(music, 0, SMILCover.framecount)
the overflow results in the framecount of 'am' being truncated to some arbitrary value, which ultimately affects the length of 'musicbite'. A larger starting framecount (eg 100000) could produce a truncated value which happens to work because it is large enough to exceed the desired value SMILCover.framecount.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.