SVCD to DVD Video Workflow in Linux

Although many new DVD, HD-DVD and Blu-ray players sold in the United States don't play SVCDs directly, the firmware in these players can still decode a 480x480 mpeg2 SVCD video stream if it is properly burned onto a DVD. This document explains how to convert an SVCD to a DVD by reencoding the audio track without reencoding the video.

The resulting DVD produced by this method is not compliant with DVD standards and therefore may no play properly in all players. This is the price we pay to avoid the quality loss that would result from transcoding the SVCD video stream into DVD compliant stream. Note that the video streams on a VCD may also be burned onto a DVD following the same method outlined here. In this case the video streams on the resulting DVD will be compliant with standards.

Ripping the SVCD

Use vcdxrip to extract the audio/video files from the SVCD.
$ vcdxrip -i /dev/cdrom
Note that SVCDs do not have the same kind of error detection and correction that data CDs and DVDs have so this may be tricky.

Encode the Audio at 48000hz

Although many DVD players play back non-compliant video streams, they all seem to require a compliant 48Khz audio stream. Therefore, the 44.1Khz audio track from the SVCD needs to be transcoded to a DVD compliant 48Khz audio track. This can be done with
$ mpeg3cat -a0 avseq01.mpg >avseq01.m2a
$ ffmpeg -i avseq01.m2a -y avseq01.wav
$ sox -V avseq01.wav -r48000 avseq01-48.wav
$ toolame -b192 -s48 avseq01-48.wav avseq01-dvd.m2a

Multiplexing the Video

If the SVCD video stream was earlier edited with GOPChop then there may be a non-zero audio/video offset. You must specify this offset when multiplexing the primative streams to avoid audio/video desynchronization. You may find the offset with
$ mpeg2desc -m <avseq01.mpg
The units of the offset is given in terms of 1/90000ths of a sec. Divide the the output of mpeg2desc by 90000 to obtain an offset measured in seconds suitable for mplex. This can be done automatically with the commands

$ mts=`mpeg2desc -m <avseq01.mpg`
$ sec=`echo $mts / 90000.0 | bc -l`

after which the environment variable $sec will contain the offest. Now extract the primative video stream using
$ extract_mpeg2 avseq01.mpg >avseq01.m2v
and multiplex it with the resampled audio track with
$ mplex -O${sec}s -f8 avseq01.m2v avseq01-dvd.m2a -o avseq01-dvd.mpg

Converting SVCD Stills

To convert an SVCD still to a png image use the commands
$ mpeg3cat -v0 item0019.mpg >item0019.m2v
$ ffmpeg -i item0019.m2v -vframes 1 -f yuv4mpegpipe -y /dev/stdout |
    y4mscaler -O chromass=444 |
    y4mtoppm |
    pnmtopng >item0019.png

Writing the DVD

Prepare the menus for the DVD by taking the png files and adding button highlights. Then make the DVD using the remultiplexed SVCD tracks above.
Last Updated: Mon Mar 28 00:26:57 PDT 2011