View Full Version : Adding SUBS to Avisynth script files?????
Knoxy
17th July 2003, 16:00
Hi all,
I'm using Avisynth 2.52 and would like to add English "srt subtitles"
to a film I'm planning on converting from an AVI file to DVD film.
But Avisynth doesnt like the contents of the script file I'm trying to use with the Mainconcept encoder. I'm getting a invalid argument
when trying to preview before encoding, using Windows media player. It seems to be something to do with Textsub!. This is the first film I have tried to encode with subtitles. Can someone tell me where I'm going wrong?
I just recently downloaded the vsfilter plug-in to see if this would help me as well as visited various topics within the forum but couldnt find an particular topic that seemed to help me resolve this problem.
Loadplugin ("C:\Program Files\AviSynth 2.5\plugins\VSFilter.dll")
v1 = AVIsource("C:\Water.avi")
a1 = WAVsource("C:\Water.wav")
textSub("C:\Water.srt")
V1 = audiodub(v1,a1)
ConvertToYUY2()
convertfps(25)
Your help would be appreciated.
P.S. I dont know if this should be in the Avisynth or subtitles section I suppose it covers a bit of both.
:confused:
unmei
17th July 2003, 16:51
-you dont need loadplugin
a1 = WAVsource("C:\Water.wav")
textSub("C:\Water.srt")
i think this will try to add the sub to the /audio/
if you really want/need to use the "x=" you better put
v1 = AVIsource("C:\Water.avi")
v1 = textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
because omitting the source clip will take the last lines output, in this case the audio a1
Knoxy
17th July 2003, 17:48
Originally posted by unmei
-you dont need loadplugin
a1 = WAVsource("C:\Water.wav")
textSub("C:\Water.srt")
i think this will try to add the sub to the /audio/
if you really want/need to use the "x=" you better put
v1 = AVIsource("C:\Water.avi")
v1 = textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
because omitting the source clip will take the last lines output, in this case the audio a1
Thanks for the quick reply unmei,
This is a copy of the amended script file:
v1 = AVIsource("C:\Water.avi")
v1 = textSub("C:\DarkWater.srt")
a1 = WAVsource("C:\DarkWater.wav")
v1 = audiodub(v1,a1)
ConvertToYUY2()
convertfps(25)
But I'm still getting the error message,invalid arguments to function "textSub"
Can you suggest anything esle to try?
Regards :confused:
Ghim
17th July 2003, 21:45
Don't you have to tell on what you'll apply the filter ?? If you don't tell him, he won't know how to apply it...
Try this (you can easily write a shorter script, but it's my way of scripting :p) :
v1 = AVIsource("C:\Water.avi")
v1 = v1.textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
v1 = audiodub(v1,a1)
v1 = v1.ConvertToYUY2()
v1 = v1.convertfps(25)
return v1
Here's the short way if you want (It may be simpler to understand...):
v1 = AVIsource("C:\Water.avi").textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
audiodub(v1,a1)
ConvertToYUY2()
convertfps(25)
Knoxy
17th July 2003, 22:06
Originally posted by Ghim
Don't you have to tell on what you'll apply the filter ?? If you don't tell him, he won't know how to apply it...
Try this (you can easily write a shorter script, but it's my way of scripting :p) :
v1 = AVIsource("C:\Water.avi")
v1 = v1.textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
v1 = audiodub(v1,a1)
v1 = v1.ConvertToYUY2()
v1 = v1.convertfps(25)
return v1
Here's the short way if you want (It may be simpler to understand...):
v1 = AVIsource("C:\Water.avi").textSub("C:\Water.srt")
a1 = WAVsource("C:\Water.wav")
audiodub(v1,a1)
ConvertToYUY2()
convertfps(25)
Thanks alot Ghim the first way works a treat, Now I have another problem!
when I test the script file via Windows Media player, the screen at the beginning of the film flashes intermitently green and when subtitles appear on the screen the previous subtitles are still showing behind the current subtitles.
Has this something to do with the fact that the original AVI is 29fps
and I'm trying to convert to 25fps, which is knocking the frames within the film well out of sync?
Is there something I could add to your script to correct this problem?
Regards: confused:
Ghim
17th July 2003, 22:11
Firts try to delete the line concerning the convertfps.
If the problem's still there : try to delete the YUY2 conversion line.
And so you'll be able to tell where the pb is...
If you've deleted the two lines, try to add an Info() line to get informations on the clip... and tell me those.
Knoxy
17th July 2003, 22:59
Originally posted by Ghim
Firts try to delete the line concerning the convertfps.
If the problem's still there : try to delete the YUY2 conversion line.
And so you'll be able to tell where the pb is...
If you've deleted the two lines, try to add an Info() line to get informations on the clip... and tell me those.
Ghim,
I've now deleted both those lines.. I tried changing the arguments held within the two lines in question to see if I could resolve but to no avail. I even deleted the two lines completely then ran the script via Windows Media player and the problem still persists. I think its connected to the fact that the film was encoded using Xvid. Possible incompatability/bug with Xvid and Avisynth??
The thing is I've coverted many a film with the Xvid codec and there have been no problems..it just seems to be this film and the fact that its 29fps whereas all other films I've converted with the xvid codec has had 23fps.
Where should I add the info() line with the script to get you information?
Thanks :confused:
Ghim
17th July 2003, 23:52
You can add info() whenever you want...
it will show informations concerning the video...
I tried with xvid videos on my side and I don't have this pb...
I don't think I'll be able to help you more, since I don't have the video to test it... It would be helpfull if you would upload a part of the video on a website so I could try and see where the pb is...
Knoxy
18th July 2003, 00:06
Originally posted by Ghim
You can add info() whenever you want...
it will show informations concerning the video...
I tried with xvid videos on my side and I don't have this pb...
I don't think I'll be able to help you more, since I don't have the video to test it... It would be helpfull if you would upload a part of the video on a website so I could try and see where the pb is...
Ghim,
Do you have an Instant Messaging Address? and I can send it via IM by the way the sample I'm Planning to send you is 10mb is that OK?
unmei
18th July 2003, 01:03
im not sure if what i imagine is the same than what you encounter...i had single frames with green when a subtitle was showing up or disappearing sometimes some time ago. it was like the edges were black burn into a green wax (???)
i dont exactly know what caused it to disappear, but i think it must either have been a update to VSfilter or one to Xvid, or something in the chain, like a filter before textsub i used before (unlikely and i could not remember which one..) as you now say you get it already before encoding it was probably the VSfilter, maybe you should update that (currently 2.27, i think i only had it in the time i used 2.25)
Knoxy
18th July 2003, 01:32
Originally posted by unmei
im not sure if what i imagine is the same than what you encounter...i had single frames with green when a subtitle was showing up or disappearing sometimes some time ago. it was like the edges were black burn into a green wax (???)
i dont exactly know what caused it to disappear, but i think it must either have been a update to VSfilter or one to Xvid, or something in the chain, like a filter before textsub i used before (unlikely and i could not remember which one..) as you now say you get it already before encoding it was probably the VSfilter, maybe you should update that (currently 2.27, i think i only had it in the time i used 2.25)
I'm currently using the latest vsfilter.dll, could you tell me where the vsfilter.dll file should go within Windows XP e.g. Do you only place the dll in the avisynth plugin folder? or the system32 folder as well?
There also seems to be two versions of vsfilter.dll when you unzip the file, they are as follows:
1. release
2. release unicode
I'm assuming I would use the unicode version with Windows XP?
Thanks :confused:
unmei
18th July 2003, 16:33
hehe good question, i just found i had vsfilter in the pugin directory too and when i deleted it it was no longer found by avisynth, so in my system it needs to be in both places (the regsvr'ed in system32 for normal display, the other for avisynth)
and yes unicode is always good when you can use it (as its the case with XP) ^^
Knoxy
19th July 2003, 14:11
Guys,
I managed to resolve the conflict with the film I was trying to convert. By updating to the latest xvid codec. As Avisynth didnt seem
to like the old Xvid codec I was using!
Thanks for all your help anyway! :D
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.