Log in

View Full Version : RealText subs


31 Flavas
16th December 2002, 23:17
I've been dicking around with RV9 since its release in April or so and dropped it for a while because of stuff happening in my life (college) then picked it up again around August to experiment with RealText subs. Now understandably, RealNetworks didn't create RealText subs with the intentions of this website in mind, but ultimatly I was kind of dissapointed with RealText subtitling.

I deal with mostly 4:3 anime (no black bars to put the subs in) so I figured out how to do overlay subtitles with a completely transparent backround. I also learned how to do fonts, colors, and size increases to make the subs look better, but that's beside the point. I was dissapointed that I couldn't put some kind of border or shadow just around the text. The subtitles would dissappear sometimes when they just happened to be the same color as whatever they were appearing over. You could get a kind of vistigual border if you set the bgcolor attribute of the <window> line in the .rt file to black, but it really didn't help all that much. Or if you surrounded some text with a <font> tag and set its bgcolor to black you'd get a black backround for that text, better than not doing it, but I'd rather not do it that way.

Karl could you comment on this? Are bordered and/or shadow'd RealText subs something someone, or Real for that matter, could impliment by tweaking the source code?

karl_lillevold
17th December 2002, 01:35
I did not know the answer so I had to forward your question. I got a couple of replies:
===
a) Make 2 transparent .rt files, one on top but slightly shifted over and down for the other. make one whiteand one black.

(b) Like (a), but make only one .rt file with two copies of the same text in it, one offset from the other by using the <pos x="..." y="..."/> tag. This is also a hack, but ~1/2+ as CPU-intensive since the RT renderer does the first "blend". Example:

<window wordwrap="false" width="400">
<font size="+3">
<font color="red" ><pos x="2" y="0"/>Blue text with a red shadow.</font>
<font color="blue"><pos x="3" y="1"/>Blue text with a red shadow.</font>
</font>
</window>

Note: it's always advisable to set wordwrap="false" when using the <pos> tag since the last word ("shadow") in red might just fit in the window, but in blue it's 1 pixel to the right and thus might wrap to the next line.

Let us know how this works.

The RealText module will be open-sourced sometime next month, perhaps someone then will take it on to add a real sub-text border feature. Unfortunately, no one here at Real has resources for it right now. I would suggest you sign up on helix community, and add a feature request, probably in the datatype project.

Another possible feature that would solve this would be to add something (via SMIL 2) that would set the media color (media being the text, not the RT background) to the complimentary color of what's behind it, on a per-pixel basis. A less-resource- intensive version would be to average the center n pixels behind each letter and do black media (text) if it's closer to white, or white media if it's closer to black. This would be done in conjunction with a backgroundColor="transparent" on the text element.

31 Flavas
17th December 2002, 01:55
Originally posted by karl_lillevold

Let us know how this works.Thanks, Great idea. I'll give it a try in the next day or two and get back to you.

Thanks again.

31 Flavas
17th December 2002, 09:14
Originally posted by karl_lillevold
Let us know how this works. Hrm... The code you posted worked good. And obviously a "border" can be made can be made by using the same line offset 4 times.

But I found out that when I thew in time codes, it broke. Only showed the blue text. Is anything wrong with my code?

<window wordwrap="false" width="400" duration="0:01:00.00">
<font size="+3">
<Time Begin="0:00:00.63" End="0:00:08.00" /><clear/> <font color="red" ><pos x="2" y="0"/>Blue text with a red shadow.</font>
<Time Begin="0:00:00.63" End="0:00:08.00" /><clear/> <font color="blue"><pos x="3" y="1"/>Blue text with a red shadow.</font>
</font>
</window>

karl_lillevold
17th December 2002, 09:23
Originally posted by 31 Flavas

But I found out that when I thew in time codes, it broke. Only showed the blue text. Is anything wrong with my code?
Well, I don't really know RealText, but the <clear/> tags looked strange, so I changed to </clear> in both cases, and that seems to work :p

31 Flavas
17th December 2002, 19:20
ahh, your right. The program I use to create the subtitles does it that way, I just copy and pasted. I changed it and it works now. It's a bit of a hack (in code at least), but it produces exactly what I wanted. It'll really help out big time for the places where the text blends in.

You've been a tremendous help, thank you! (sneaks off to buy helix producer)

Now, i'll have to try out that anamorphic bit you posted about :)

31 Flavas
25th December 2002, 07:09
Originally posted by karl_lillevold

Well, I don't really know RealText, but the <clear/> tags looked strange, so I changed to </clear> in both cases, and that seems to work :p Heh heh.... <scratchs his head and toes the ground>

I just figured out why this "fix" works. First of all, we do not want to clear the previous line... We want to keep it and the rest of them so that I can get the border effect. Having the <clear/> tag before every line wipes out the cumulative bordering; Therefor it is no wonder that "adding the time codes" (as I said) broke the bordering / shadowing. Changing the <clear/> tag to </clear> "un-breaks" the problem only because we are now breaking <clear/> itself!!!

Ahh... The joy of learning :)

31 Flavas
26th March 2003, 22:20
These are links to other RealText subtitle threads. Both contain basic info and info for transparent subtitles.

http://forum.doom9.org/showthread.php?s=&threadid=47243

http://forum.doom9.org/showthread.php?s=&threadid=30840

karl_lillevold
26th March 2003, 22:23
excellent!

now all that's left for 31 Flavas' Guide to Sub-titles in RV9 is to copy and paste the most relevant information into one post :)

31 Flavas
27th March 2003, 00:09
As I karl mentioned, i'm gonna start to work on single coherent HOWTO for RealText subs basic and transparent. But for now these links to other posts should suffice.

Of course, feel free to ask me for creating and/or debugging help in this thread or by PM.