<div dir="ltr"><div class="gmail_default" style="font-size:small">Like the line in one of the URLs that reads "and why interlacing should be abandoned asap".<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 30, 2023 at 3:21 AM Andrew Randrianasulu via Cin <<a href="mailto:cin@lists.cinelerra-gg.org">cin@lists.cinelerra-gg.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><a href="https://www.qsl.net/n1gg/linux/video/linuxdvdguide.html#6" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://www.qsl.net/n1gg/linux/video/linuxdvdguide.html#6</a><div dir="auto"><br></div><div dir="auto">=====</div><div dir="auto"><table><tbody><tr><td width="2%"></td><td><font><h3 style="font-family:arial,helvetica,sans-serif"><br></h3>
<hr style="font-family:arial,helvetica,sans-serif">
<br>
<h3 style="font-family:arial,helvetica,sans-serif">Chapter 6: Subtitling</h3><font face="arial, helvetica, sans-serif">
Subtitling is an integral part of many DVD productions.
Although I personally have used subtitles very rarely, this guide would
not be complete without some information about subtitles.</font><br><font face="arial, helvetica, sans-serif">
Many times it is necessary to subtitle video if the audio language
needed is not available, or for the hearing impaired, or to add
commentary.
The DVD specification allows for a very nice subtitling method.
Instead of having to render the text on the video itself (which would
mean you could not turn the subtitling off), DVD implements subtitling
as a series of images overlayed on top of the video.
This way, you can switch between multiple subtitle tracks, or turn them
off altogether.
Although this takes up more data space than plain text subtitles, it is
far more versatile: the fact that images are used makes it possible to
subtitle using any font and even nonstandard characters and images.</font><br>
<br>
<h4 style="font-family:arial,helvetica,sans-serif">6.1 DVD Subtitle Format</h4><font face="arial, helvetica, sans-serif">
The DVD subtitle specification allows for 4-color images with a
transparent background. They can be created in nearly any format, but
must be converted to the special DVD compliant stream before they can be
put into the DVD structure.</font><br>
<br>
<h4 style="font-family:arial,helvetica,sans-serif">6.2 Subtitling MPEG Streams For DVD Using Spumux</h4><font face="arial, helvetica, sans-serif">
Spumux is one such tool to create DVD subtitle streams.
Although there are many tools for subtitling, Spumux is very useful in many areas and I have experience with it.</font><br><br><font face="arial, helvetica, sans-serif">
It accepts several image formats, including PNG, which I find to be the
most beneficial format (not just for DVD operations but for many other
things as well).</font><br><br><font face="arial, helvetica, sans-serif">
First you must create your text images. You may do this with your
favorite image editor
(IMHO, if you have a brain, it's Gimp), or you may use a text-to-image
tool to make the images from your plain text such as Fly (which i will
not cover here).
Spumux will also accept subtitles in a number of text formats. See the
manpage for a list of them.
Since using spumux with text files can be extremely complicated, and
there are multiple options for file formats, etc., I will only cover
using PNG images for subtitling here. </font><br><br><font face="arial, helvetica, sans-serif">
So open Gimp, (or whatever image creator that suits your fancy), and
create a new image with a transparent background.
Actually you may have a colored background if you like, but bear in mind
that this may distract from your video.
Sometimes this is necessary, such as if you have white text on a
white-dominated video scene (such as snow), but most of the time this is
distracting and looks cheap.
Choose a color for your text. I have found that most of the time the
best color for subtitle text is a light gray or white.
Then use the text tool to create your subtitle text, and slap it onto
the background.
Be sure that you do not use more than 4 colors in your image, as spumux
will reject the file if it has more.
The DVD specification only allows for any 4 colors in a particular
subtitle stream
If you did use more than 4 colors, such as for a fancy gradient text or
something, or possibly if you used anti-aliased fonts, you may set the
image type to indexed, and dither the image down to 4 colors.
In Gimp, right-click on the image, go to the "Image" sub-menu, the
"Mode" sub-sub-menu, and select "Indexed...".
Optionally, you may get to this dialog using the keyboard by pressing
"ALT+I".
Then make sure that the "Generate Optimal Palette:" option is checked,
and set the number of colors to 3 or 4.
Then save the image as PNG.</font><br><br><font face="arial, helvetica, sans-serif">
It is interesting to note that since the DVD subtitle method is to use
images, you may put, well, images into the subtitle stream, and they
will display just like text.
Of course you are still limited to 4 colors, but this comes in extremely
handy for foreign language subtitles, and when you need special fonts
and text styles.</font><br><br><br><font face="arial, helvetica, sans-serif">===</font><br><font face="arial, helvetica, sans-serif">Interesting info!</font><br><br><font face="arial, helvetica, sans-serif">Also, there was another page suggesting yuv420 option useful for *NTSC* interlaced DV to DVD</font><br><br><font face="arial, helvetica, sans-serif"><a href="https://renomath.org/video/linux/dv/encdvd.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://renomath.org/video/linux/dv/encdvd.html</a><br></font><br>====<br>Our focus is encoding widescreen NTSC
interlaced video source from a miniDV camcorder. We attempt
to preserve as much of the quality of the original source as
possible. <br><br>[..]<br><br><h2>Mjpegtools</h2>
The mjpegtools encoder runs more slowly than ffmpeg on my computer;
however, no patches are needed to handle interlaced video.
The encoding commands
<pre>$ lav2yuv s001.avi |
yuvcorrect -T INTERLACED_BOTTOM_FIRST |
mpeg2enc -M0 -nn -a3 -f8 -G18 -b7000 -V230 -q9 -o s001.m2v
$ lav2wav s001.avi > s001.wav
$ toolame -b224 -s48 s001.wav s001.m2a
$ mplex -f8 s001.m2v s001.m2a -o s001.mpg
</pre>
work, but unfortunately reduce the effective color space to 4:1:0.
Better results can be obtained by using y4mscaler
and the commands
<pre>$ lav2yuv s001.avi -C 411 |
y4mscaler -I ilace=BOTTOM_FIRST -O chromass=420mpeg2 |
mpeg2enc -M0 -nn -a3 -f8 -G18 -b7000 -V230 -q9 -o s001.m2v
$ lav2wav s001.avi > s001.wav
$ toolame -b224 -s48 s001.wav s001.m2a
$ mplex -f8 s001.m2v s001.m2a -o s001.mpg
</pre>
This interpolates the chroma in the horizontal direction
before subsampling it vertically. <br><br>====<br><br>Yet another source suggest only old CRT TV <br>can display interlaced DVD material as intended, and Plasma/TFT<br>TV or computer monitors better accept de-interlaced material.<br><br><a href="https://xpt.sourceforge.net/techdocs/media/video/dvdvcd/dv04-Interlace/single/" target="_blank">https://xpt.sourceforge.net/techdocs/media/video/dvdvcd/dv04-Interlace/single/</a><br></font></td></tr></tbody></table></div></div>
-- <br>
Cin mailing list<br>
<a href="mailto:Cin@lists.cinelerra-gg.org" target="_blank">Cin@lists.cinelerra-gg.org</a><br>
<a href="https://lists.cinelerra-gg.org/mailman/listinfo/cin" rel="noreferrer" target="_blank">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
</blockquote></div>