Log in

View Full Version : Problem with Avisynth 2.5.7


hartford
6th January 2008, 04:37
I'm using Avisynth v1.5.7

I made a clip using a bmp file to make a title.

I added silent audio using:

function AddAudio(clip v1) {
v2 = Blankclip(audio_rate=48000,stereo=True,sixteen_bit=True)
v1 = AudioDub(v1,v2)
return v1
}


When I tried to join the "title file" to the avi that I captured I got various errors.

It seems that the above function adds too much audio, ie,
when I opened the title file in VirtualDub and viewed Video > Framerate > I saw the option to adjust the video
to the audio rate of 29.972 fps.

I never had this problem using Avisynth version 1.5.6.

I fixed it this way: open the file in VirtualDubMod, keeping the check boxes

"Offset audio" and "Cut off Audio"; save it; open saved file
with a script using:

assumefps("ntsc_video",true),

even tough the file was ntsc, and the file before "conversion" was 33367us,
and the audio rate matched.

Only then could I splice the files.

Something is not right with Avisynth 1.5.7, or I'm doing something stupid.

Sagekilla
6th January 2008, 04:59
Might I ask why you're using such an old version of Avisynth to begin with?

hartford
6th January 2008, 05:08
<i>Might I ask why you're using such an old version of Avisynth to begin with?</i>

1.5.7 is "old?"

I'm not inclined to use versions that cause "trouble" for me.

Are you saying that my problems would be solved by using a newer version? Or that I should use an earlier version?

Have you tried what I have done?

burfadel
6th January 2008, 06:01
If it really is version 1.5.7 then its VERY old! Are you sure you don't mean 2.5.7? 2.5.7 is the latest official stable release and shouldn't cause any problems. If you are using 2.5.7 and you have this problem, I'm sure someone may be able to help you on here.

Note: If you are using 1.5.7, make sure you uninstall it before installing 2.5.7!

Guest
6th January 2008, 06:06
function AddAudio(clip v1) {
v2 = Blankclip(v1,audio_rate=48000,stereo=True,sixteen_bit=True)
v3 = AudioDub(v1,v2)
return v3
}

hartford
6th January 2008, 06:08
If it really is version 1.5.7 then its VERY old! Are you sure you don't mean 2.5.7? 2.5.7 is the latest official stable release and shouldn't cause any problems. If you are using 2.5.7 and you have this problem, I'm sure someone may be able to help you on here.

Note: If you are using 1.5.7, make sure you uninstall it before installing 2.5.7!

Sorry, yes, version 2.5.7.

hartford
6th January 2008, 06:10
function AddAudio(clip v1) {
v2 = Blankclip(v1,audio_rate=48000,stereo=True,sixteen_bit=True)
v3 = AudioDub(v1,v2)
return v3
}

I love your cryptic replies.

Adub
6th January 2008, 07:12
It's not cryptic. It should be what you are looking for. Meaning example code.

jeffy
6th January 2008, 11:01
I'm using Avisynth v1.5.7



function AddAudio(clip v1) {
v2 = Blankclip(audio_rate=48000,stereo=True,sixteen_bit=True)
v1 = AudioDub(v1,v2)
return v1
}




Do you see?

stickboy
6th January 2008, 11:44
I'm using Avisynth v1.5.7
When I tried to join the "title file" to the avi that I captured I got various errors.You should always provide the error messages.

If you still don't understand neuron2's reply:

You neglect to pass a clip argument to BlankClip. Consequently, BlankClip will generate its own clip of some arbitrary length.

stickboy
6th January 2008, 11:45
Do you see?Hmm? That's not the problem.

jeffy
6th January 2008, 13:48
Hmm? That's not the problem.

I'm sorry, I thought it was.

hartford
8th January 2008, 04:02
You should always provide the error messages.

If you still don't understand neuron2's reply:

You neglect to pass a clip argument to BlankClip. Consequently, BlankClip will generate its own clip of some arbitrary length.

The error messages that I got were along the lines of "video rate doesn't match," even when both of the vids were 33367us long. I only discovered the audio-length problem using VirtualDubMod.

I just did neuron2's script (sorry about the "cryptic" thing, I was very tired). When I open the resulting file in VirtualDubMod and
went to Video > Framerate I see under "Source rate adjustment" the following:

<i> Change so video and audio durations match (29.972fps).</i>

The script doesn't help. There is one extra audio frame added, ie, the video is 181 frames, the audio is 182 frames.

[edit]

I have been using the function that I first posted for quite some time (was recommended some time by someone when Avisynth went from 2.55 to 2.56) without a problem.

If I need to use VirtualDubMod to cut the extra frame, so be it.

[end edit]

[edit2]

Under VirtualDubMod Report: Video and audio streams are equal in terms of timing.

I don't know what to make of that.

[end edit2]

[edit3]

VirtualDub 1.7.7 doesn't "see" the discrepancy whereas VirtualDubMod and VirtualDubMpeg2 do see the rate difference.

[end edit3]

stickboy
8th January 2008, 06:00
The error messages that I got were along the lines of "video rate doesn't match," even when both of the vids were 33367us long. I only discovered the audio-length problem using VirtualDubMod.Rates and duration are not the same thing.
I just did neuron2's script (sorry about the "cryptic" thing, I was very tired). When I open the resulting file in VirtualDubMod and
went to Video > Framerate I see under "Source rate adjustment" the following:

<i> Change so video and audio durations match (29.972fps).</i>

The script doesn't help. There is one extra audio frame added, ie, the video is 181 frames, the audio is 182 frames.Post your complete script.

Maybe it's just some difference in how VirtualDub and VirtualDubMod round? Does each program report the same number of audio samples? (There are no "audio frames".)

hartford
9th January 2008, 05:36
Rates and duration are not the same thing.
Post your complete script.

Maybe it's just some difference in how VirtualDub and VirtualDubMod round? Does each program report the same number of audio samples? (There are no "audio frames".)

VirtualDub 1.7.7 reports that all is OK.

VDMod and VD-MPEG2 notice the discrepancy in the drop-down menues.


My scripts are simple.


I made a bmp file using Corel 10. It is Text on a black background. Resolution is 720x480.

From that I did:

ImageSource("e:\Title_File.bmp", end =150)


Next I did something like (I don't have the avs):

Avisource("Title_File.avi")

Dissolve(blackness(last, 48), last, 20)

Dissolve(last, blackness(last, 48), 20)


Just adding black frames to the end and beginning, with fading.


Then I tried adding null audio, and that is the problem.

[edit]

My time is limited, so all of this is a bit foggy.

The "title" clip was converted to NTSC at some point, and then the null audio was attempted to be added.

As I said above, didn't have this problem with 2.5.6, that I can't seem to find in order to verify my results.

foxyshadis
9th January 2008, 22:01
Avisynth 2.5.6 (http://sourceforge.net/project/showfiles.php?group_id=57023&package_id=72557&release_id=366697)

hartford
15th January 2008, 05:15
Avisynth 2.5.6 (http://sourceforge.net/project/showfiles.php?group_id=57023&package_id=72557&release_id=366697)

Thanks for the pointer to 2.5.6. I installed it .

Unfortunately, this hasn't solved my problem. I don't understand why this simple script is producing this problem. I don't understand why it worked before, but not now.

I know how to fix it, and that is what I'll do. I've spent too much time on this.

It would be nice if someone would try to reproduce this error.

Just generate a blankclip, add audio to it and then join it to a previously recorded clip.

But nobody did that.

Thanks again, foxy.

stickboy
15th January 2008, 09:16
Please post your exact script.

hartford
30th January 2008, 03:44
I finally fixed it by splicing using AlignedSplice, ie "++" rather than UnalignedSplice, ie "+".

That was my mistake. Not a Bug. Just me not fully understanding, after 3 years of using this software, of what I was doing. http://forum.doom9.org/images/smilies/mad.gif
:mad: