(to the German Version...)

A Way to Create SVCDs
with a Start Menu

Version 2.0

Manfred Schmidt-Voigt, Hamburg 2002

There are for sure many ways leading to Rom and also many ways leading more or less to a perfect Super Video CD (SVCD). Many people have developed a lot of programs and scripts, to make this favorable format usable. There are also a lot of commercial programs existing (Nero, ...) or Freeware/Open Source (VCDImagerEasy, ...), which try to hide this problem from the user behind a high sophisticated GUI.

But it needs many steps to bring the recordings of the exiting powerful VDR (Klaus Schmidinger and more...) more or less automatically without much manual intervention onto CD. There exist a lot of programs and script (perl, shell...) for all these steps. But if there are additional whishes or if you like to use the code pieces in your own way then there are always breaks in the process for which you have to create your own solutions by programming or scripting.

This was also my problem and, as you can see by the questions of a lot of mail list members, I am not alone. To share my experience now with others I have worked on this problem and developed a complete process for me with some helpful scripts, which I like to document here.

System landscape:

My VDR contains:

ASUS A7VI-VM 800MHz Duron and 128MB Ram
10GByte for Linux ( Suse 8.0) (/)
30GByte for SVCD-Images (/mpeg)
120GByte XFS (/video)
1xDVB-S V1.3 (Galaxy)

My CD burner is in my W2k/Linux(Debian Woody) Workstation (750MHz Athlon), which contains more GBytes.

Network is 100Mbit

Requirements for the Automatization Process

Basically it should be possible to split the overall process (translating the VDR files into a SVCD format, then to compile and burn the images to CD) between these two machines. It only important to run the time and CPU consuming steps on that system, which is not used by the other family members with interactive work and now and then a reboot. The most time-consuming step is the translation from VDR format to SVCD format with the following creation of the SVCD images. I leave this to the VDR system in background. I do the following burning of the CD on the W2k/Linux system with Linux (if my people let me do). Here is also my burner connected.

My wishes for a SVCD

For many people on this mailing list its enough just to clean the recordings from the ADs rubbish and write these with files a maximum compression to SVCD or into another format (DVD or Divx).The CD's are written up to it's limits and then continued on the next one without taking care of scene changes or breaking dialogs. This may be OK if you copy the whole movie back to harddisk before watching it again. In the first cutting versions from Klaus there was only the possibility to write the cut peaces together up to the chosen limit of the VDR files. I asked him in the past if its possible to have the file boundaries also at the cutting points and he included this possibility (SplitEditedFiles = 1).

My SVCDs should end on a logical limit (scene change). Additional I like to watch my SVCDs with a standard DVD player. So I have to change the SVCD during a movie (a good point to grab a new can of beer). And because I'm not any more the youngest guy on earth (and after several beer) I will forget the first part of a sentence, if there is not a logical cut between these CDs.

OK, I would like to have a mostly conform CD to the standard SVCD. But you can not get everything in life. Because I use tosvcd (from Werner Schweer) for the conversion from VDR format to SVCD format with all the tools (mjpeg,...) have I to it, like Werner, without a standard conform sound. But the 48kHz of the sound are accepted by my DVD player like a charm and I hope, that the machines of the future will accept it to ( but maybe we will copy everything then on SCOTCH tape or into one of the new biological memories, (dunghill??)).

I addition to this I like to have a good menu in which I keep all the nice info for a movie from www.tvtvt.de (epg2timer), We have this info as the summary.vdr already. Or we can use the EPG data from the stations ( if they will be sometimes able to get it right).

Because I had problems starting and stopping SVCDs with my first tries of burning good SVCDs and with the different windows tools especially when I used the first SVCD patches, I always use now a small intro movie and a similar outro movie.

Structure of the CD

click for an example XML


The following is a short description of the steps in the process. The detail are contained in the inline documentation of the scripts.

The automatic steps with my scripts are printed in bold font.

  1. Record with VDR
  2. Cutting ADware
  3. process cutting (button 2)
  4. Cut on length and scene change (I get around 40min movie part on a 80min/700Mb CD)
  5. Its not necessary to process the cutting again. tosvcd reads the cutting marks directly from marks.vdr.
  6. Movie into todo list (toconvert.txt) (look into AIO-Patch or the German page
    http://home.t-online.de/home/hubertus.sandmann )
  7. From the VDR menu "Commands" use "run conversion" . This will start the script svcd.sh
  8. Starting with first Directory out of toconvert.txt and create a new directory name without any special characters
  9. create new directory beneath the /mpeg directory
  10. symbolic link of the ???.vdr and the index.vdr files
  11. Create a new marks.vdr file with a pair of cut marks for one CD
  12. Conversion with tosvcd
  13. Creating the still-video files out of the file summary.vdr (Colors could be changed to get your own flavor)
  14. create SVCD Images
  15. The Volume ID will be created out of the directoryname with a lengh of 30 Characters. So it's possible to include a running number like _1, _2 at the end of the name.
  16. Now for each Movie file will be compiled one XML file for the creation of the Image with vcdxbuild
  17. First create the Header of the XML file
  18. Create the Segment Section for the still Mpegs on the first CD in the directory
  19. Create the Sequence Part for the 3 Movie files intro.mpg, mpegx.mpg, outro.mpg
  20. Create the Selection Part, also the Menu according to the number of Still Mpegs
  21. At the end write the Play list for the Movie files
  22. Now start the real Compilation of the XML Files to the Image files with vcdxbuild.
  23. For all pairs of cut marks go to (11)
  24. Cleanup - Delete all *.vdr and all temp files
  25. For all directories go to (9)
  26. The pure burning process will be controlled by another script (cdrdaobatch.sh) on myW2K/Linux Workstation under Debian. This is only a semiautomatic process because I have no automatic disk changer. I must still make the disc jockey. Here I have mounted the /mpeg directory per Samba (Samba - because I use this directory also with my W2K Workstation).

  27. The script cdrdaobatch.sh works again though all the directories beneath the current one and searches for image files
  28. The burning process itself needs some time according to the burning speed, so I don't sit the whole time beside the burner.
  29. If a CD is finished the script signals this with a bell and wait on <enter> for the next CD.
  30. OK, change CD and press <enter> , etc....
Yes, that becomes really easy now. And I hope that I can watch all these recorded movies someday. But who knows, this could be done may be by another script :-)....


For the creation of toconvert.txt files I use this little Shell Script:


#set -x TODOLIST=/video/toconvert.txt
[ `echo $1 >> ${TODOLIST}` ] && echo "Error with the TODOLIST ${TODOLIST}!!!"

The name of the script will be passed by the "-Z" parameter in the runvdr script to the vdr. If it's accidentally not possible to write a new entry into the ToDoList (echo Command malfunction) there will be an error message written to the console.

The script svcd.sh will be called not directly from the commands.conf but from another little script:


#set -x
nice -n 19 /usr/local/bin/svcd.sh

In my commands.conf are the following commands important for the conversion process:


run conversion     : if [ `ps -ef | grep -e "/svcd.sh"| grep -c -v grep` -eq 0 ];then at now -f /usr/local/bin/tosvcd.sh && echo "conversion started";else echo "Already running";fi
status conversion : [ -f /mpeg/status ] && cat /mpeg/status; [ -f /mpeg/TOSVCD.log ] && cat /mpeg/TOSVCD.log |tr "\r" "\n"|tail -1
view jobs : cat /video/toconvert.txt|cut -c1-38
clear jobs : rm -f /video/toconvert.txt && echo "clean"
list /video/mpeg : cd /mpeg; du -sk */*.mpg |cut -c1-38

The status of the Conversion can be watched by two Log files. The Status file contains only messages about the overall process, while the TOSVCD.log contains also all the details about the conversion. But for me only the last line is interesting during the conversion.



Here comes a small Tip for those who used the NVRAM WAKEUP program:

During the conversion with external scripts or programs VDR does not know what the system is doing else. In this time there should no automatic shutdown occur. I do that in this way:


#set -x
# $Id: vdrshutdown,v 1.10 2002/03/15 22:25:38 bistr-o-math Exp $
if [ `ps -ef | grep svcd.sh | grep -c -v grep` -eq 0 ]
    /sbin/hwclock_wrapper --systohc
    $NVRAMCMD -ls $1
    case $PIPESTATUS in
         0) # all went ok - new date and time set
            shutdown -h now
         1) # all went ok - new date and time set.
            # *** but we need to reboot. ***
            # for some boards this is needed after every change.
            # for some other boards, we only need this after changing the
            # status flag, i.e. from enabled to disabled or the other way.
            # For plan A (see README file for more details) - uncomment
            # the touch line (don't forget to change your boot script)
            # and comment out the lilo line
            # For plan B - uncomment the lilo line and comment out the touch line
            # (don't forget to install the modified kernel image first)
            # touch /nvramboot
            lilo -R PowerOff
            shutdown -r now
         2) # something went wrong
            # don't do anything - just exit with status 1
    echo `date`">>>>>>>>> no shutdown - svcd.sh is active <<<<<<<<<">>/var/log/messages
# exit with 0 if everything went ok.
# exit with 1 if something went wrong


Used Software for the Scripts

vdcimager http://www.vcdimager.org/
tosvcd http://muse.seh.de/tosvcd/
netpbm http://sourceforge.net/projects/netpbm/
cdrdao http://cdrdao.sourceforge.net/
I am not responsible for the content and the existence of the mentioned URLs


All the other additional necessary software/libraries (e.g. mjpegtools...) must be loaded by the other packages. It helps to read the description from Hubertus Sandmann (http://home.t-online.de/home/hubertus.sandmann) and of course the pages of the VDR-Portal (http://www.vdrportal.de). Both are in German.

Thank You to:

all, which have worked on the VDR (specially. Klaus Schmidinger) and to all those, which have created the Patches and Plugins and all the good ideas.

And also for the good ideas and descriptions from Stefan Uchrin (edv-tip) and Tony (TJW) (Tip from Jürgen Hahn).


Version 1.0 15.09.2002 first Version
Version 1.1 06.10.2002

better Log files for svcd.sh
flexible directory structure in vcdbatch.sh
Description of the configuration

Version 1.2 13.10.2002 English translation
Version 2.0 07.09.2003 Integration of the Imagegeneration into svcd.sh