January 2004

Closed Captioning Guidelines

Here’s a PDF file about how closed captions should be written.


Comments (0)


Correcting Subtitle Colors

The quest to get the subtitle colors correct continues. Xine shows different colors when viewing the VOB file than playing the DVD. Ogle shows the same colors (black/black) regardless except it won’t play when no audio device is available. This was fixed by adding this to ~/.oglerc


I read through the dvdauthor documentation and it says if the subtitles come from spumux, the color palette will be passed. If not, you can specify it as such in your project.xml file:

<pgc palette="subtitle.rgb">

<vob file="project-sub.mpeg" />

Here is the subtitle.rgb file with values that match the defaults set in xste’s global subtitle palette.



That did the trick!


Comments (0)


XSTE Fixes and Subtitle Colors

I got a nice email back from Jan Panteltje, the author of xste. He’s adding in more error messages and the frame rate fix into his next release, so hopefully fewer people will be hitting themselves in the head ;-).

He also answered a question I had regarding the colors of the subtitles. I was getting different colors than what I had specified in xste. This isn’t related to xste, but the player. He’s had success with Ogle and standalone players, but color problems with Xine and MPlayer. Specifically, he said MPlayer uses it’s own colors. I’m getting all-black subtitles in Xine and Ogle, but white with grey outlines in MPlayer.

I tried to test out the DVD in my standalone player, a Pioneer DV-414 (more than three years old). The first disk I burned on DVD+RW played on this machine, to my surprise, but this one doesn’t. The difference is this movie has subtitles (probably not it) and this movie is made up of three parts. Neither had a menu. Also, the second movie was rewritten over the same disk. I’ll try reburning a single title DVD and burning to a fresh DVD+RW.

The reburned single-title DVD played, but the picture was broken up badly–the DV-414 was struggling to read it. Maybe I got lucky getting it to read the first DVD+RW. On the hypothesis that a re-burned DVD is harder to read for an older player (just a guess, really), I burned a freshly formatted DVD+RW. This played fine. After a few more tests, I’m of the opinion that reburning a disk makes it harder for my older player to read it. It doesn’t have anything to do with presence of subtitles, multiple titles or anything like that. The first burn plays fine, but subsequent burns either don’t play at all or have that nasty, broken-up, highly pixelated video.

As for the subtitles, my Pioneer is showing them all-black, just like Xine and Ogle. This leads me to believe Xine, Ogle and my standalone player are fine and MPlayer is doing its own thing. Oh, to play from the DVD:

xine -u 0
If the control window doesn’t show up, right click in the video window and select GUI visibility. Then click DVD in the control window.

ogle /dev/dvd
Turn on subtitles on the control window. It’s the icon second from the right on the bottom row (just left of the movie camera icon).

mplayer -sid 0 /dev/dvd
Nice, except you can’t rely on the colors it displays.


Comments (0)


I found a better way to create the MPV file:

extract_mpeg2 project.mpeg > project.mpv

Then copy project.mpv to /video/vie/project/.

I was still getting the “frames per second” error. This turned out to be an error in the source code in xste-3.2.5/video.c line 161:

if ( video_file_fps != dframes_per_second )

will fail due to approximate representations of floating pointnumbers. I changed the code to:

if ( fabs(video_file_fps - dframes_per_second) >= 0.001 )

That fixed the error message, but I still didn’t have preview video. Then I got this error on stdout: xste: preview_display(): video size 720 x 480 not equal selected display size 720 x 576. After screwing around with mpeg utilities to convert my video to 720×576, I hit myself in the head and changed vert size to 480 on the xste main screen. I clicked on another subtitle line and the video was there! I tried different lines and it updated the subtitles but not the video. That’s when I noticed this error on stdout:
mpeg3video_seek: frame accurate seeking without a table of contents is no longer supported. Use mpeg3toc <mpeg file> <table of contents> to generate a table of contents and load the table of contents instead.

So in /video/vie/project:

mpeg3toc project.mpv project-toc.mpv

and load project-toc.mpv when the preview video button asks for the mpv file.

Now to add subtitles to my video. The Output button on the xste main window creates ~/.subtitles/project/project.sub.

From the ~/.subtitles/project directory:

submux-dvd -P /mnt/edit/project/project.mpeg project.sub /mnt/edit/project/project-sub.mpeg
You have to do this from the directory where you ran xste because the paths to the bmp files are stored in project.sub as relative, not absolute.

From /mnt/edit/project, edit your DVD XML file and change the name of the MPEG file to the new MPEG+Subtitles file you just created. Then create your DVD files:

rm -rf dvd; dvdauthor -o dvd -x project.xml

Play the new dvd directory with

Ogle: ogle dvd/VIDEO_TS

or MPlayer: mplayer -sid 0 dvd/VIDEO_TS/VTS_01_1.VOB

or Xine: xine -u 0 dvd/VIDEO_TS/VTS_01_1.VOB


Comments (0)


XSTE Preview

The mpv file I swiped from Kino export whilst it was in the middle of working (it deletes it after mplex) caused this error from xste: Frames per second error in /video/.vie/project/project.mpv
29.970 is different from 29.970 specified in main form
this will give timing errors


Tried SMILutils. This is a tar xf; configure; make; make install type installation. The magic incantation this time is smil2yuv kino.smil -a project.mp2 | yuvscaler -O VCD | mpeg2enc -o project.mpv -f 1. Same error from xste unfortunately.


Comments (0)


Resizing a Linux ext3 Partition

The DVD editing partition is mounted at /mnt/edit. It’s an ext3 file system. To back it up, I put in a DVD+RW, changed to /mnt and ran growisofs -M /dev/dvd -R -J edit. About 20 minutes later, the 3.7GB was backed up.

Parted is supposed to be able to resize an ext3 file system, but version 1.6.3 complains No Implementation: This ext2 filesystem has a rather strange layout! Parted can’t resize this (yet). This is strange because print shows the system to be ext3. Mm-kay. I remember reading that it’s easy to switch between ext2 and ext3 and found the following commands to do so:

ext3 -> ext2: tune2fs -O '^has_journal' /dev/hdb2

ext2 -> ext3: tune2fs -j /dev/hdb2

Alas, parted still complained about the partition in its ext2 incarnation. Some Googling turned up references to this error as an unresolved Parted issue due to Parted using an old version of ext2resize. The recommendation is to use the utility directly. So I downloaded and installed (rpm -Uvh) ext2resize-1.1.17-1.i386.rpm from the ext2resize site. The man page for ext2resize says it only resizes the file system, not the partion. To resize the partion, you should delete and recreate it with fdisk making sure you use the same starting position. Hey, I made a backup, right? On exit of fdisk, it said there was a problem reloading the partition table and the kernel would use the old one. Time for a reboot.

So far, so good. Next command is ext2resize /dev/hdb2 which will resize the file system to fill the partition (now about 104GB). No errors. Converted back to ext3 and mounted. Touchdown!


Comments (0)


SCSI Emulation of IDE DVD Drive

Before getting too far into the DVD creation project, I thought I’d increase the size of my editing partion. Yes, these are the things I think when I wake up at 6 am. It’s 40GB, but since it’s a quarter full already and I’ve got lots more video to work with, I want to avoid the hassle later. The first step is backing up what’s there. Why not use the DVD drive? I poped in a DVD+RW and clicked on the DVD icon on my desktop. Instead of the directory listing in Konqueror, a message box came up telling me

Could not mount device.

The reported error was:

mount: wrong fs type, bad option, bad superblock on /dev/dvd, or too many mounted file systems

(could this be the IDE device where you in fact use ide-scsi so that sr0 or sda or so is needed?)

Pretty nice error message, huh? I had set up IDE-SCSI emulation earlier for the DVD burning tools, but I didn’t update my entries in /etc/fstab nor my links in /dev. /dev/dvd was pointing to /dev/cdrom which was pointing to /dev/hdc and there was no entry for the DVD in /etc/fstab. So I added /dev/dvd /mnt/dvd udf,iso9660 user,noauto,kudzu,ro 0 0 to /etc/fstab and made /dev/dvd point to /dev/scd0. Now I got “no medium” when I put a disk in. cat /proc/scsi/scsi told me the Plextor PX-708A was on scsi host scsi1, channel 0, id 0, lun 0 but not which device in /dev it was attached to. This ought to be in /var/log/messages (dmesg) but thanks to long uptimes and having a million Windows machines bombarding my firewill, the startup messages scrolled out of /var/log/messages*. After scratching my head awhile and contemplating a reboot to see the startup log, I remembered scd0 is the first SCSI CD device–my older Plextor PX-W1210S, which is actually a SCSI unit. After changing /dev/dvd to point to /dev/scd1, it mounted. I need some coffee.


Comments (0)


Using XSTE

I went into Kino and exported sound from one of my movies (Export/Audio). The default sample rate was 32KHz, so I changed it per the xste documentation to 44.1KHz. xste requires the name of this file to be sound.wav and it must be in ~/.subtitles/project/sound.wav. Also, click the green button that says AUDIO RAW so that it turns yellow and says AUDIO WAV.

Hitting the AUTO button causes xste to generate a list of frame numbers corresponding to when speaking occurs. This sorta works. Then you chose the number from the list and listen to what’s there and transcribe it. There’s a subtitle preview, but I need to get a .mpv file out of Kino for this. SMILUtils will do it, but the site is down now. I’ll try tomorrow.


Comments (0)


Building XSTE

I’ve installed submux-dvd and xste. xste required xforms and libmpeg3 . Note xforms is supposed to be available from Savannah, but it isn’t there now. The link I have here I found from Googling. It seems just fine.

These are all source packages, which I put in /usr/local/src. Everything compiled without a hitch except xste. It seems the make install of libmpeg doesn’t install libmpeg3.a in /usr/local/lib and xste didn’t know where to find the xforms header files, so in xste-3.2.5/Imakefile, I had the make the following additions:

EXTRA_LIBS = -lpthread -lfreetype -L/usr/local/src/libmpeg3-1.5.3/i686

EXTRA_INCLUDES = $(FREETYPE2INCLUDES) -I/usr/X11R6/include/X11 -I/usr/local/src

and add a softlink in /usr/local/src so that libmpeg3 points to libmpeg3-1.5.3. Make these changes before you do any compiling. If you didn’t, you’ll have to start over at the xmkmf step. Not a big deal really.


Comments (0)



I just finished the latest issue of Linux Journal. The article on DVD authoring caught my eye, of course. It covers territory similar to what I’ve been doing, but nothing new. I was hoping they’d mention a project to automate adding either captions or subtitles, but no luck. BTW, I’ve yet to evaluate submux-dvd and xste, two tools that might help with this. More on this soon.

Also in this issue, there was an article on transcoding, which was something I’d heard of, but was unfamiliar with. It’s the process of transferring a video in one format to another. For example, converting the MPEG-2 format found on DVDs to MPEG-4, which can compress the stream enough to fit on CD-R disks, which are more easily produced and at less cost. Interesting, but not where I’m going.


Comments (0)