[Cin] Old page on DVD creation under Linux (2005)

Andrew Randrianasulu randrianasulu at gmail.com
Tue May 30 11:21:39 CEST 2023




Chapter 6: Subtitling 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.
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.

6.1 DVD Subtitle Format 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.

6.2 Subtitling MPEG Streams For DVD Using Spumux 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.

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).

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.

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.

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.

Interesting info!

Also, there was another page suggesting yuv420 option useful for *NTSC*
interlaced DV to DVD


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.


Mjpegtools The mjpegtools encoder runs more slowly than ffmpeg on my
computer; however, no patches are needed to handle interlaced video. The
encoding commands

$ lav2yuv s001.avi |
    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

work, but unfortunately reduce the effective color space to 4:1:0. Better
results can be obtained by using y4mscaler and the commands

$ 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

This interpolates the chroma in the horizontal direction before subsampling
it vertically.


Yet another source suggest only old CRT TV
can display interlaced DVD material as intended, and Plasma/TFT
TV or computer monitors better accept de-interlaced material.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20230530/3acea377/attachment.htm>

More information about the Cin mailing list