Log in

View Full Version : Subtitles - AviSynth + VobSub


lpinho
9th January 2003, 00:21
Hi there,

I use VobSub to add subtitles to a movie, I wish to encode it with CEE or TMPGenc, but I'm having some kind of problem.

If I open the .avs file with Windows Media Player the subtitles appear, but if I open the .avs file with TMPGEnc or CCE the subtitles don't appear...

Here is the script I use:


LoadPlugin("C:/WINDOWS/SYSTEM32/mpeg2dec.dll")
LoadPlugin("C:/WINDOWS/SYSTEM32/VOBSUB.DLL")
video = MPEG2Source("G:/movie/movie.d2v")
audio = WavSource("G:/movie/movie.wav")
VobSub(video,"G:/movie/movie")
LanczosResize(video,720,448,0,0.68)
ResampleAudio(audio,44100)
AudioDub(video,audio)


Can anyone help me?

Thank You

Pinho

[edit 1] -> And now TMPGenc encoder acts very weird, the ouput movie is full of colored vertical bars....

[edit 2] -> Just found out that after unstalling VobSub TMPGEnc no longer adds the vertical bars....

[edit 3] -> My goal is for the subtitles to be harcoded in the mpeg file

Boulder
9th January 2003, 08:18
You could try ripping the subtitles from the VobSub files with SubRip and then use TextSub (in the VobSub package) to display them. Works for me this way. If you use the SubRip format, you can also edit the subs and their appearance as it's ASCII.

hakko504
9th January 2003, 09:20
Originally posted by lpinho

LoadPlugin("C:/WINDOWS/SYSTEM32/mpeg2dec.dll")
LoadPlugin("C:/WINDOWS/SYSTEM32/VOBSUB.DLL")
video = MPEG2Source("G:/movie/movie.d2v")
audio = WavSource("G:/movie/movie.wav")
VobSub(video,"G:/movie/movie") #The result from this operatioon is not put into video, but into 'last'
LanczosResize(video,720,448,0,0.68) #Here 'last' is overwritten with the resized video.
ResampleAudio(audio,44100) #And here you make 'last' an empty video with correct 44khz sound.
AudioDub(video,audio) #And finally you return the original audio and video together.


LoadPlugin("C:/WINDOWS/SYSTEM32/mpeg2dec.dll")
LoadPlugin("C:/WINDOWS/SYSTEM32/VOBSUB.DLL")
video = MPEG2Source("G:/movie/movie.d2v")
audio = WavSource("G:/movie/movie.wav")
# See the difference?
video = VobSub(video,"G:/movie/movie") #Now you take 'video', add subtitles to it and puts it back into 'video'
video = LanczosResize(video,720,448,0,0.68) #And then you take the 'video' (now including subs) and resize it.
audio = ResampleAudio(audio,44100) #Then you resample the audio
AudioDub(video,audio) #And finally you interleave the resample audio with the resized, subtitled video

lpinho
9th January 2003, 16:52
Huummm I'll try it.

I thought that if you place as a parameter the "video" it would change the variable value..

Thanks

Pinho

hakko504
9th January 2003, 17:09
Nope, sorry. All arguments to a function in AviSynth is input only and can not be changed by the function. In order to do that you must do as I did, x=f(x). There are ways around it, by using the implicit 'last', like this:LoadPlugin("C:/WINDOWS/SYSTEM32/mpeg2dec.dll")
LoadPlugin("C:/WINDOWS/SYSTEM32/VOBSUB.DLL")
video = MPEG2Source("G:/movie/movie.d2v")
audio = WavSource("G:/movie/movie.wav").ResampleAudio(audio,44100)
AudioDub(video,audio)
VobSub("G:/movie/movie")
LanczosResize(720,448,0,0.68)

scmccarthy
9th January 2003, 17:25
That's right, unless you reset what video means with equal signs, it keeps on refering to the first instance of video. Also, it is best to mux the video and audio early and drop the use of them with the other filters.

Stephen

lpinho
9th January 2003, 23:27
Well it worked exacly like you said, thank you for all the help...


Pinho