View Full Version : DivX and subtitle position
ihgl
12th June 2002, 10:49
Sorry to bother again but I can nowhere find a solution to this and maybe there is none. I have a downloaded DivX - Ben Hur 640x240 and SSA-subtitles. It is easy to merge them with the movie using Virtual Dub and then convert to SVCD. But as far as I understand it does not seem possible to position the subs in the black border under the movie. It is a bit disturbing having them in the movies area, since it is very narrow. You can easily do all this if you start with vob-files, working it out with Virtualdub and vobsub. But I only have the completed movie and some SSA-files. Is there a work around?? Thankful for comments on this.
Shuichiro
12th June 2002, 14:34
maybe you should try with this combo TMPEG, Virtual Dub and subtitler.
ihgl
12th June 2002, 15:17
Originally posted by Shuichiro
maybe you should try with this combo TMPEG, Virtual Dub and subtitler.
I tried that one yesterday without success. TMPGenc complained: "Illegal stream" or something. But I will give it a new go. I do not see though how there could be a difference compared to the methods I already used. Maybe I am wrong or the matter is "mission impossible" because there might be no way to change that the AVI, downloaded is as is - completed and you have no access to the vob-files end so on.
Willem_1010
12th June 2002, 17:23
If you can find a subrip or microdvd subtitle of the movie, you can convert it to a ssa subtitle using some converter. In this converter you can edit the location of the subtitles.
Hope this will help you.
Willem
ihgl
12th June 2002, 18:21
Originally posted by Willem_1010
If you can find a subrip or microdvd subtitle of the movie, you can convert it to a ssa subtitle using some converter. In this converter you can edit the location of the subtitles.
Hope this will help you.
Willem
Thank you, but my original subs are in SRT-format and I have used SRT-SSA and alsp Subcreator for the conversion to SSA. But you can place them anywhere but under the movie as far as I understand.
Schultz
13th June 2002, 03:19
Not sure how you are encoding your files.. If your movie is 16:9 already and you are encoding with black borders in TMPG. Or if you movie already has black borders and you wish to place the subs lower.. If the black area is already there.. Then try using TextSub Vd plugin which comes with VobSub 2.14 you can open a ssa file with this and then play around with the styles to hopefully position the subs where you want..
If you Divx file does not have black borders in the video yet.. Then you will have to do the Resizing/adding the black borders in VD and then add the TextSub filter placeing the subs into the black area that you have created. and then FrameServe it out to TMPG.. you could also use AviSynth for frameserving and adding the black borders but this is a little bit more advanced if you haven't delt with AviSynth at all.
Ok after re-reading your post it looks like you have to go with method 2 and add the black borders before you place the subs into the video to get them into the black area.
ihgl
13th June 2002, 15:01
Originally posted by Schultz
Not sure how you are encoding your files.. If your movie is 16:9 already and you are encoding with black borders in TMPG. Or if you movie already has black borders and you wish to place the subs lower.. If the black area is already there.. Then try using TextSub Vd plugin which comes with VobSub 2.14 you can open a ssa file with this and then play around with the styles to hopefully position the subs where you want..
If you Divx file does not have black borders in the video yet.. Then you will have to do the Resizing/adding the black borders in VD and then add the TextSub filter placeing the subs into the black area that you have created. and then FrameServe it out to TMPG.. you could also use AviSynth for frameserving and adding the black borders but this is a little bit more advanced if you haven't delt with AviSynth at all.
Ok after re-reading your post it looks like you have to go with method 2 and add the black borders before you place the subs into the video to get them into the black area.
Thanks for your concern, have read about this in one of your earlier threds but cold not really get it to fit my specific case. Understood though that it had something to do with the "border matter". As far as I understand the DivX has big black borders from the very start. Lately I have started to use CCE and Avisynth for encoding (DVD2SVCD)and since the movie is a 640X240 23,679 NTSC which I convert to PAL I have to modify the resize settings in Avisynth to get the right aspect ratio.
SimpleResize(480,240)
AddBorders(0,168,0,168)
This to be changed to:
SimpleResize(480,294)
AddBorders(0,141,0,141)
Well this thread is not an Avisynth one so back to the matter: I tried VD as a frameserver for TMPGenc (SSA-subs and vdr-file)the other day but it said "illegal stream.." all the time. I am still an amateur on these things, but I think that the VobSub 2.14 - method possibly will apply. I will give it another try, and if you are kind enough I will get back för another "consultation". Thanks, you have given me ideas.
Schultz
13th June 2002, 15:35
Originally posted by ihgl
Thanks for your concern, have read about this in one of your earlier threds but cold not really get it to fit my specific case. Understood though that it had something to do with the "border matter". As far as I understand the DivX has big black borders from the very start. Lately I have started to use CCE and Avisynth for encoding (DVD2SVCD)and since the movie is a 640X240 23,679 NTSC which I convert to PAL I have to modify the resize settings in Avisynth to get the right aspect ratio.
SimpleResize(480,240)
AddBorders(0,168,0,168)
This to be changed to:
SimpleResize(480,294)
AddBorders(0,141,0,141)
Well this thread is not an Avisynth one so back to the matter: I tried VD as a frameserver for TMPGenc (SSA-subs and vdr-file)the other day but it said "illegal stream.." all the time. I am still an amateur on these things, but I think that the VobSub 2.14 - method possibly will apply. I will give it another try, and if you are kind enough I will get back för another "consultation". Thanks, you have given me ideas.
If a person cropped out the black bars then there shouldn't be any black bars left in them.. During playback i know filters like DVobSub, DivxG400, Subtitler DS all extend the video to add black borders during playback to place the subtitles in that area. So either way you would need to make sure to place the black in the exported version. Also i haven't dealt with TMPG much. But i just did a quick test using VD and exporting to TMPG 2.00 and it worked.. Though i made sure i had the Server Hooks installed.. to make sure this go into your VD directory and execute the AuxSetup.exe file and click the Install Handler. this will make sure the VD frameserver is installed. hopefully that solves you problems with illegal stream you are getting.
Also this is a little off topic.. if you use Dvd2svcd to do DVD's you can also use it to transform avi's. and then just edit the avs script before you encode it and place two lines after the resize in the script like..
LoadPlugin("Path\to\textsub.vdf")
TextSub("path\to\subtitlefile.ssa")
textsub.vdf is installed into yoru virtualdub directory if you choose to install it during hte install process.
And this will allow dvd2svcd to do all of it for yea..
ihgl
13th June 2002, 20:05
Originally posted by Schultz
If a person cropped out the black bars then there shouldn't be any black bars left in them.. During playback i know filters like DVobSub, DivxG400, Subtitler DS all extend the video to add black borders during playback to place the subtitles in that area. So either way you would need to make sure to place the black in the exported version. Also i haven't dealt with TMPG much. But i just did a quick test using VD and exporting to TMPG 2.00 and it worked.. Though i made sure i had the Server Hooks installed.. to make sure this go into your VD directory and execute the AuxSetup.exe file and click the Install Handler. this will make sure the VD frameserver is installed. hopefully that solves you problems with illegal stream you are getting.
Also this is a little off topic.. if you use Dvd2svcd to do DVD's you can also use it to transform avi's. and then just edit the avs script before you encode it and place two lines after the resize in the script like..
LoadPlugin("Path\to\textsub.vdf")
TextSub("path\to\subtitlefile.ssa")
textsub.vdf is installed into yoru virtualdub directory if you choose to install it during hte install process.
And this will allow dvd2svcd to do all of it for yea..
Thanks again. Have done some homework and it all starts to figure. Regarding TMPGenc I used the same procedure as you, it just does not work. Anyway, I managed to put some borders to the AVI in VD and then used VobSub 2.14 with this new sub plugin (used 2.09 until today ;-) )and it seems to work great. Since I have abandoned TMPGenc for DVD2SVCD with CCE I will also try the Avisynth way you pointed out. Again a very bright idea really impossible for me to make out on my own. I really appreciate the time and bother this has cost you. On the other hand, this should be of interest to many out there. With the methods lined out we could all make good subs in this kind of downloaded AVI movies not having to merge them with the movie itself.
Regards
It will be a damned good Ben Hur SVCD tomorrow. ;-)
ihgl
14th June 2002, 13:38
Originally posted by Schultz
If a person cropped out the black bars then there shouldn't be any black bars left in them.. During playback i know filters like DVobSub, DivxG400, Subtitler DS all extend the video to add black borders during playback to place the subtitles in that area. So either way you would need to make sure to place the black in the exported version. Also i haven't dealt with TMPG much. But i just did a quick test using VD and exporting to TMPG 2.00 and it worked.. Though i made sure i had the Server Hooks installed.. to make sure this go into your VD directory and execute the AuxSetup.exe file and click the Install Handler. this will make sure the VD frameserver is installed. hopefully that solves you problems with illegal stream you are getting.
Also this is a little off topic.. if you use Dvd2svcd to do DVD's you can also use it to transform avi's. and then just edit the avs script before you encode it and place two lines after the resize in the script like..
LoadPlugin("Path\to\textsub.vdf")
TextSub("path\to\subtitlefile.ssa")
textsub.vdf is installed into yoru virtualdub directory if you choose to install it during hte install process.
And this will allow dvd2svcd to do all of it for yea..
Merging the subs with the NTSC -DivX file works great. Modifying the AVS-script to get them work with DVD2SVCD and CCC also works but unfortunately the subs are a bit delayed and gets moore and moore out of sync. It has certainly got something to do with framrate and the conversion to PAL because it all plays perfect not converted. So my last question is how to complete the AVS-script to get the substream modified to suit PAL?
Schultz
14th June 2002, 14:05
I haven't done a NTSC to PAL before. So i don't know where DVD2SVCD actually changes the framerate over.. Let me look but actually here is the full command line for TextSub
TextSub("path\filename.ext"[, charset[, fps]])
so you can do something like
TextSub("path\filename.ext",fps=25)
But the problem i think what type of subs are you attempting to use? if its srt or ssa it shouldn't have a conversion problem because they are all Time based and not framerate based. and you can actually modify the subs with SubResync to adjust for the times.. here is a part from subresync docs.
Set one "waypoint" to correct a constant offset error, set two for a simple fps modification, or set three+ for complex problems. Since the program interpolates between them, it is obvious, that the more you set the more accurate it gets.
A few samples:
No. 1: (offset error)
Original timing | Required timing
1 | 2 1 | 2 <-- extrapolated
2 | 3 --> 3 | 3 <-- manually changed
3 | 4 3 | 4 <-- extrapolated
No. 2: (fps error)
Original timing | Required timing
1 | 2 --> 2 | 2 <-- manually changed
2 | 4 2 | 4 <-- interpolated
3 | 6 --> 6 | 6 <-- manually changed
ihgl
14th June 2002, 15:46
Originally posted by Schultz
I haven't done a NTSC to PAL before. So i don't know where DVD2SVCD actually changes the framerate over.. Let me look but actually here is the full command line for TextSub
TextSub("path\filename.ext"[, charset[, fps]])
so you can do something like
TextSub("path\filename.ext",fps=25)
But the problem i think what type of subs are you attempting to use? if its srt or ssa it shouldn't have a conversion problem because they are all Time based and not framerate based. and you can actually modify the subs with SubResync to adjust for the times.. here is a part from subresync docs.
Set one "waypoint" to correct a constant offset error, set two for a simple fps modification, or set three+ for complex problems. Since the program interpolates between them, it is obvious, that the more you set the more accurate it gets.
A few samples:
No. 1: (offset error)
Original timing | Required timing
1 | 2 1 | 2 <-- extrapolated
2 | 3 --> 3 | 3 <-- manually changed
3 | 4 3 | 4 <-- extrapolated
No. 2: (fps error)
Original timing | Required timing
1 | 2 --> 2 | 2 <-- manually changed
2 | 4 2 | 4 <-- interpolated
3 | 6 --> 6 | 6 <-- manually changed
I really have to do some more homework here.. Well, as I said, the subs work perfectly merged into the DivX. The same if I use NTSC (No conversion). Since they are of the SSA-format and time based I also got a bit confused. I use "Subcreator" to stretch, edit subs and it works great. I will try some of your new ideas and thank you again for your kind help and your great patience ;-)
Schultz
15th June 2002, 12:34
Originally posted by ihgl
I really have to do some more homework here.. Well, as I said, the subs work perfectly merged into the DivX. The same if I use NTSC (No conversion). Since they are of the SSA-format and time based I also got a bit confused. I use "Subcreator" to stretch, edit subs and it works great. I will try some of your new ideas and thank you again for your kind help and your great patience ;-)
Ok i did some more testing.. When you edit the Avisynth script in DVD2SVCD and place the TextSub command after the AssumeFPS it does make the subs go out of sync.. if you place it before then they are properly sync'ed. I am going to run a test but i don't see a problem since you want them in the black area. You should be able to do this. Place the TextSub command after the resize/addborders.. Then Place the AssumeFPS command after the TextSub command so you should have something like this..
LoadPlugin("F:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
LoadPlugin("F:\PROGRA~1\DVD2SVCD\INVERS~1\DONALD~1\decomb.dll")
LoadPlugin("F:\PROGRA~1\VirtualDub\plugins\textsub.vdf")
mpeg2source("E:\SAMARI~1\DVD2AV~1.D2V")
Telecide()
Decimate(5)
TextSub("E:\SAMARI~1\Samarix.ssa")
BicubicResize(480,576,0,0.75)
TemporalSmoother(2,1)
AssumeFPS(25,1,True)
ResampleAudio(44100)
i am going to do a test with this and see if it messes anything up.. but i don't think it will..
ihgl
15th June 2002, 15:36
Originally posted by Schultz
Ok i did some more testing.. When you edit the Avisynth script in DVD2SVCD and place the TextSub command after the AssumeFPS it does make the subs go out of sync.. if you place it before then they are properly sync'ed. I am going to run a test but i don't see a problem since you want them in the black area. You should be able to do this. Place the TextSub command after the resize/addborders.. Then Place the AssumeFPS command after the TextSub command so you should have something like this..
LoadPlugin("F:\PROGRA~1\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
LoadPlugin("F:\PROGRA~1\DVD2SVCD\INVERS~1\DONALD~1\decomb.dll")
LoadPlugin("F:\PROGRA~1\VirtualDub\plugins\textsub.vdf")
mpeg2source("E:\SAMARI~1\DVD2AV~1.D2V")
Telecide()
Decimate(5)
TextSub("E:\SAMARI~1\Samarix.ssa")
BicubicResize(480,576,0,0.75)
TemporalSmoother(2,1)
AssumeFPS(25,1,True)
ResampleAudio(44100)
i am going to do a test with this and see if it messes anything up.. but i don't think it will..
Well, thank you. I am still working on it as well. Another way is to save your -SRT in "Frame Format", this will give you a -txt - file with correct frame timing. You can do that in "SubCreator". Then you get a perfect sync, the problem only is that the subs get some kind of default style and size - far too big. I have not figured out how to change that - although it might be possible, I think this would be an easy solution. Also you can compensate for time compression, converting to PAL from NTSC by a factor of 29,679/25 = 0,9590 plus entering the start timestamp a bit earlier. The movie gets some minutes shorter as a PAL. This is hard and hazardous though - but it works. I also started to work on the AVS modification regarding where to place the new FPS parameter. On the form:
TextSub("path\filename.ext"[, charset[, fps]]) I got syntax error all the time..
I will immediately start that over again following your new excellent "homework". So long.
Schultz
15th June 2002, 15:44
Originally posted by ihgl
Well, thank you. I am still working on it as well. Another way is to save your -SRT in "Frame Format", this will give you a -txt - file with correct frame timing. You can do that in "SubCreator". Then you get a perfect sync, the problem only is that the subs get some kind of default style and size - far too big. I have not figured out how to change that - although it might be possible, I think this would be an easy solution. Also you can compensate for time compression, converting to PAL from NTSC by a factor of 29,679/25 = 0,9590 plus entering the start timestamp a bit earlier. The movie gets some minutes shorter as a PAL. This is hard and hazardous though - but it works. I also started to work on the AVS modification regarding where to place the new FPS parameter. On the form:
TextSub("path\filename.ext"[, charset[, fps]]) I got syntax error all the time..
I will immediately start that over again following your new excellent "homework". So long.
Well my commands up there where a little outta order.. should have the TextSub after the Resize.. and that test i didn't have the borders added.. And i belive TextSub.vdf gets it properties for srt files from the default view config dialog in DirectVobSub so you probably can change it there and it will change for when it is being encoded. and i never thought about doing the time changes like you done which is a another good idea for the situation..
ukendt
15th June 2002, 16:42
AddBorders(0,41,0,241)
ihgl
15th June 2002, 20:56
Yes, I think that a sufficient solution is found at last. Looking at the script the main thing of interest is off course the order of statements. I have done some tests and will do more, but it really seems as though this is it! So, if converting from NTSC to PAL this would get the subs in good sync with the movie. And since we use SSA-subs we have all options available regarding style, positioning and so on:
LoadPlugin("C:\Program\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\Program\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("C:\Bart\Filmjobb\BENHUR~1\Jobb\TESTBE~1.AVI")
LoadPlugin("C:\Bart\DVDRippning\Apps\VirtualDub & Avisynth\VirtualDub\plugins\textsub.vdf")
ConvertToYUY2()
SimpleResize(480,294)
AddBorders(0,141,0,141)
TextSub("C:\Bart\test.ssa")
AssumeFPS(25,1,True)
I would like to thank mr Schulz once more for a great deal of help, without his hints I would not have been able to get this far. Since the subject would be of great interest to many - especially to anyone with the PAL standard, it might be worth a guide of its own.
At last a summary:
You have a (downloaded?) DivX movie, NTSC, cropped and widescreen
You have some sub-file, SRT or SSA..
You would like to add subs in perfect sync and put them under the movie and not merge them with it.
Use this thread!
And if you do NTSC to NTSC this would do:
LoadPlugin("C:\Program\DVD2SVCD\SIMPLE~1\SIMPLE~1.DLL")
LoadPlugin("C:\Program\DVD2SVCD\MPEG2Dec\mpeg2dec.dll")
AVISource("C:\Bart\Filmjobb\BENHUR~1\Jobb\TESTBE~1.AVI")
LoadPlugin("C:\Bart\DVDRippning\Apps\VirtualDub & Avisynth\VirtualDub\plugins\textsub.vdf")
ConvertToYUY2()
SimpleResize(480,240)
AddBorders(0,120,0,120)
TextSub("C:\Bart\test.ssa")
Regards
Schultz
16th June 2002, 05:09
Originally posted by Schultz
Well my commands up there where a little outta order.. should have the TextSub after the Resize.. and that test i didn't have the borders added.. And i belive TextSub.vdf gets it properties for srt files from the default view config dialog in DirectVobSub so you probably can change it there and it will change for when it is being encoded. and i never thought about doing the time changes like you done which is a another good idea for the situation..
Also i am wrong in this section if you read the supported formats.txt file in the docs to define a style in a Srt file then you just copy the [STYLE] section out of a ssa file and put it in a file name
filename.srt.style
then DVobSub / TextSub will use this style when doing the encoding.. Also the style must be kept named Default.
Also i know the examples i was using didn't add the borders cause my test material was 4:3 not 16:9 and it was off DVD not a cropped avi.. but like you said all you would have to do is add the borders.. But dvd2svcd will put this in when you select it..
But glad to see you got it working ihgl.. :)
ihgl
16th June 2002, 10:43
Yes, my original strategy was to merge the subs with the cropped DivX somehow and then convert the DivX to a SVCD. But this idea, directly using DVD2SVCD to make all the job is off course by far superior and saves you a huge deal of time. Using Frame Format txt-files shure is a secure way to go as well, especially since you found out how to edit them, so there is another touch. I think I will stick to the DVD2SVCD method though ;-) Thanks again and regards.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.