Log in

View Full Version : Really strange avisynth problem


Mentalmummy
24th November 2004, 04:09
Apologies for what may be a long post and hope this posts as my other one showed up empty :o

I have a weird avisynth 2.5 problem which has suddenly sprung up for no apparent reason.

I have some avisynth scripts that are identical except for one line which says to assume an ntsc film fps in one script and pal in the other. Like so....

ConvertAudioToFloat()
SSRC(48000)

Now the pal one has the correct audio rate of 48000 while the ntsc film one (identical script) has a rate of 46034 Khz instead.

Unfortunately this means I cannot convert the audio without extra steps in between as headac3he will not accept the audio nor will other programs I`ve tried. Running the 46034 audio through the SSRC program simply tells me that 46034 to 48000 Khz audio conversion is not allowed.

I`ve found a work around which is to take out the SSRC command in the script and let the command line SSRC program handle that seperately but I wanted to post this information here in case anyone has had this situation and could advise what might cause it.

I have not installed any new software other than the latest alpha of avisynth and the lcc win32 compiler (now uninstalled to check if it had some effect).Avisynth was working fine until a few days ago. I`ve tried replacing it with the original 2.5 again but it made no difference.

Apologies for a long post but I am genuinely stumped about the cause.

Dave

sh0dan
24th November 2004, 10:10
Post the entire script!

Mentalmummy
24th November 2004, 12:17
Okay, here is the script for pal conversion :o

AviSource("C:\AVI\video_data\video.avi", true)
ConvertToYV12()
Lanczos4Resize(352, 576)
SSRC(48000)
ConvertAudioToFloat()
AssumeFPS(25.000, true)

And here is the one for ntsc film conversion

AviSource("C:\AVI\video_data\video.avi", true)
ConvertToYV12()
Lanczos4Resize(352, 480)
SSRC(48000)
ConvertAudioToFloat()
AssumeFPS(23.976, true)

I can use the commandline SSRC program called on its own to change the audio to 48000 so if no one else has come across this I don`t want to waste peoples time with what may be a quirk of my system.

The problem does occur when using the ntsc script to process any avi that the pal version is okay with. I can`t think of a cause but the standalone SSRC program which I downloaded does work and avisynth was handling it fine so could it be a registry error?

Although it all checks out as being okay is there any line in the registry that, if damaged, could affect the audio sampling area of the program?

If so I can check the registry manually to look for a discrepancy. My operating system is Windows XP Pro.

I have checked my pc for viruses, etcetera in case something had got through my firewall and altered a system file somewhere but everything shows up as okay.

While I`m posting I have to say thankyou for avisynth as it`s helped me do everything I need to that`s video related (even making 3D films).

Thanks :)
Dave

Mentalmummy
25th November 2004, 02:42
This is getting even weirder, since my post earlier even the workaround I found doesn`t work but I am pretty sure I now know what is happening :(

If I change the ntsc framerate to slightly higher (say 24.974 or anything nearer the pal rate) the sampling rate produced via avisynth also increases. If I decrease the frame rate the sample rate then decreases.

I am using the assumefps command to affect different framerate.

Basically decrease the framerate and the audio sample rate decreases, and vice-versa.

There is definitely a correlation between the framerate specified and the sampling rate so at least I know I`m not going mad, hope this helps perhaps pin down what might be causing it?

Dave

sh0dan
25th November 2004, 11:39
AssumeFPS(23.976, true)
The "true" option is related to audio if you watch the docs, and it will change the samplerate to match the length of the audio to the length of the video.

Move the ssrc(48000) to AFTER the framerate change (or use ResampleAudio(48000), if ssrc complains about incompatable rate changes).

Mentalmummy
25th November 2004, 12:55
I understand what you`re saying but even removing the SSRC and ConvertToAudio() commands completely still has the same effect and when I move the commands to after the AssumeFPS one it still does the same thing.

While writing this I`ve still been trying and I have made it work by replacing the SSRC command with the ResampleAudio(48000) which seems to work fine.

I then try SSRC again and have the same problem so I can do it, but I understood resampleaudio wasn`t as good? The problem only arises when AssumeFPS is used though. Without ResampleAudio the problem is still evident.

Thanks, I`m going to double check with more tests but looks like I can still use ResampleAudio instead :)

Dave