View Full Version : AVSEdit & Filters
mjliteman
1st March 2005, 21:41
I have two questions regarding this (I'm using AVISynth 2.55 & AVSEdit 1.1.1.3):
1. Don't have or cannot find SSRC filter. It's not listed in the filters tab nor is SSRC usable if I manually type in the value (i.e. when I highlight the line I don't have the option of entering parameters). ResampleAudio works fine, but everyone suggests SSRC as a better option. It's a core filter with 2.55 so I'm stumped. I installed AVISynth first, the AVSEdit with default options.
2. Related to using the filters, but more of an AVSEdit usage question. Using the latest DGIndex with AVSEdit, for example, (placed *.dll into AVISynth plugin folder). Do I need to use LoadPlugin or is it automatically loaded? If I want to use a .d2v file for MPEG source how should the script's source line be written? If I should use LoadPlugin is there a way to do this from AVSEdit (besides manually writing it out)?
I prefer a GUI mostly because it automates a lot of the typing (thus cutting down on typing errors. There are enough possibilities of errors that misspelling the file path doesn't need to be one of them). :) I could make a template AVS file as a starting point for each time, I suppose, but I prefer to create a new one to increase my familiarity with script writing and the proper usage of AVISynth/AVSEdit.
Thanks,
MJ
Wilbert
1st March 2005, 22:21
1. Don't have or cannot find SSRC filter. It's not listed in the filters tab nor is SSRC usable if I manually type in the value (i.e. when I highlight the line I don't have the option of entering parameters). ResampleAudio works fine, but everyone suggests SSRC as a better option. It's a core filter with 2.55 so I'm stumped. I installed AVISynth first, the AVSEdit with default options.
I forgot to include SSRC in the filter descriptions. You will have to do it manually for now.
2. Related to using the filters, but more of an AVSEdit usage question. Using the latest DGIndex with AVSEdit, for example, (placed *.dll into AVISynth plugin folder). Do I need to use LoadPlugin or is it automatically loaded?
It's automatically loaded.
If I should use LoadPlugin is there a way to do this from AVSEdit (besides manually writing it out)?
Not yet.
mjliteman
2nd March 2005, 05:52
Originally posted by Wilbert
I forgot to include SSRC in the filter descriptions. You will have to do it manually for now.
I made a script using SSRC and VDub gave this error(attached):
Here is my script:
AVISource("testingdivx.avi")
AssumeFPS(23.976,sync_audio=true)
SSRC(48000)
AddBorders(8,8,8,8)
LanczosResize(720,486)
Crop(0,4,0,-2)
Whether I put SSRC where it is or at the end, same error. Already tried reinstall, but no go.
MJ
Wilbert
2nd March 2005, 10:21
I saved it as a jpg to save bandwidth.
edit: SSRC only works if the ratio between the samplerate of the source and target is some specific values. You will have to use ResampleAudio here.
mjliteman
2nd March 2005, 16:19
SSRC only works if the ratio between the samplerate of the source and target is some specific values. :confused:
I'm sorry. I don't get it. What's the ratio supposed to be? I'm like a little kid - always wanting to know "Why?" If I need to use ResampleAudio it doesn't really matter to me. Thanks, Wilbert, for taking the time to answer these questions.
MJ
Wilbert
2nd March 2005, 16:38
Here's the relevant code in ssrc.c:
frqgcd = gcd(sfrq,dfrq);
fs1 = sfrq / frqgcd * dfrq;
if (fs1/dfrq == 1) osf = 1;
else if (fs1/dfrq % 2 == 0) osf = 2;
else if (fs1/dfrq % 3 == 0) osf = 3;
else {
fprintf(stderr,"Resampling from %dHz to %dHz is not supported.\n",sfrq,dfrq);
fprintf(stderr,"%d/gcd(%d,%d)=%d must be divided by 2 or 3.\n",sfrq,sfrq,dfrq,fs1/dfrq);
exit(-1);
}
example:
sfrq = 44100 -> dfrq = 48000
frqgcd = gcd(44100,48000) = 300
fs1 = sfrq / frqgcd * dfrq = 44100 / 300 * 48000 = 7056000
fs1/dfrq = 7056000 / 48000 = 147
and 147%3=0 since 47 / 3 = 49 = integer (hence osf=3 and thus the conversion is done)
c = AviSource(...)
c.Subtitle(string(c.AssumeFPS(23.976,sync_audio=true).AudioRate))
prints out the samplerate of the source clip, so that you can check for yourself.
edit: corrected script
mjliteman
2nd March 2005, 19:48
Thanks, I understand now. I'll check out the source SR.
MJ
EDIT: Thought I understood better than I did. See next post.
mjliteman
3rd March 2005, 15:20
2 quick questions:
quote:
--------------------------------------------------------------------------------
frqgcd = gcd(44100,4800) = 300
--------------------------------------------------------------------------------
How does this equation work to come up with 300?
I follow the rest up until:
quote:
--------------------------------------------------------------------------------
and 147%3=0 since 47 / 3 = 49 = integer
--------------------------------------------------------------------------------
Same question as before. Thanks.
Wilbert
3rd March 2005, 21:45
frqgcd = gcd(44100,48000) = 300
gcd means greatest common divisor, ie the largest integer which divides both numbers. To calculate it you factor both numbers (in primes):
44100 = 2^2*3^2*5^2*7^2
48000 = 2^7*3*5^3
they have the factors 2^2*3*5^2 = 300 in common.
147%3=0 since 47 / 3 = 49 = integer
a%b means 'the remainder of subtracting as many times b of a (though the result should be positive). Also called mod(b,a) (modulo).
examples:
11%5 = 1, since 11-5-5 = 11-2*5 = 1
147%3 = 0, since 147-49*3 = 0
18%4 = 2, since 18-4*4 = 2
I hope it's clear :)
mjliteman
4th March 2005, 20:23
Yeah, it's clear, but that's a far as I dare to go into the math of it. :) Reviewing what I've learned so far, I have one other question: My source file's audio is 48K MP3 (as reported in VirtualDub). When I use AssumeFPS(23.976 audio=true) it slows playback of video to 23.976 and the audio SR becomes 46xxx. If I try to use SSRC to resample back to 48K it doesn't work even though many other posts suggest this very method. Do you think it's because their source audio is 44.1K and after the slow down it's a compatible ratio?
After a couple of test conversions using ResampleAudio the audio is very low and has lots of clicks and pops. I'm thinking about doing the audio separately altogether, but I'm not sure how to keep sync that way.
MJ
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.