Introduction
Disclaimer
Software
Step 1: Ripping
Step 2: DVD2AVI
Step 3: Audio encoding
Step 4: Bitrate calc.
Step 5: Frameserving
Step 6: Video encoding
Step 7: Multiplexing
Step 8: Mastering
Step 9: Burning
FAQ
Glossary
Links

Copyright 2001-2003
by Jacob Laursen

Valid HTML 4.01!

Step 5 - Frameserving

Introduction

If we were to decode the movie to a raw AVI file before encoding it again, we would need more than 100 GB per hour (for PAL). Instead, to reduce the space requirements, we let a frameserver feed decoded frames to the encoder, one by one. A frameserver must be able to manipulate the input stream, since we have to resize the original DVD movie to SVCD format. If we want to add permanent subtitles to the stream, this must also be done by the frameserver.

There are two very good frameservers at the moment, namely VirtualDub and AVIsynth. VirtualDub has a nice GUI with real-time display of the effect all applied filters have to the input stream. AVIsynth is a script based solution without any GUI. Each has its advantages, but I've chosen AVIsynth due to its very fast resize filters.

How to

Install AVIsynth and MPEG2DEC.DLL. Now we just need to create a small script, before we are ready to encode. NTSC DVD's have a resolution of 720480, while PAL DVD's are 720576. For SVCD's it's 480480 and 480576, respectively. Thus, we must resize. If the movie is anamorphic widescreen we have to choose between keeping it that way, or letterbox it, which means adding black borders at the top and bottom. Please note that most standalone DVD players doesn't support the 16:9 flag on SVCD's, so when keeping the anamorphic format, you need either a widescreen TV or a 4:3 TV with a 16:9 feature.

Copy one of the example scripts below and modify it to your needs. You can find more info about the individual filters at the AVIsynth website. Important: You have to supply a (real) .wav file, even though we perform the audio encoding and multiplexing ourselves - if you don't, CCE will crash!

Adding subtitles

Screenshot

Install VobSub. You start it either by clicking the "VobSub Configure" icon (if provided) or simply by writing:

C:\> rundll32 vobsub,Configure
          
in a command prompt. Open the .ifo file and let VobSub save the .idx and .sub files in your movie project directory. Another window opens, which by default should have all the subtitles to extract in the right side. You don't choose which subtitles to use here, just which ones to extract - so don't do anything except clicking "OK". If an error occurs, you might want to try the "I've crossed my fingers" button instead of "OK".

Now, in the main window select the subtitles to use and quit VobSub by clicking "OK".

Examples

These scripts demonstrate the usage of AVIsynth. AVIsynth scripts have the filename extension AVS.

Example 1:
#
# AVIsynth script for NTSC (no subtitles)
# by Jacob Laursen 
#
# Source: 720x480, 16:9 (anamorphic)
# Target: 480x480, 16:9 (anamorphic)
#
# (or source/destination: 4:3)
#

LoadPlugin("C:\WINNT\system32\mpeg2dec.dll")

video = mpeg2source("C:\DVD\movie.d2v")
audio = wavsource("C:\DVD\movie.wav")
clip  = audiodub(video,audio)

BilinearResize(clip,480,480)
        
Example 2:
#
# AVIsynth script for PAL (with subtitles)
# by Jacob Laursen 
#
# Source: 720x576, 16:9 (anamorphic)
# Target: 480x576, 16:9 (anamorphic)
#
# (or source/destination: 4:3)
#
LoadPlugin("C:\WINNT\system32\mpeg2dec.dll")
LoadPlugin("C:\WINNT\system32\vobsub.dll")

video = mpeg2source("C:\DVD\movie.d2v")
audio = wavsource("C:\DVD\movie.wav")
clip  = audiodub(video,audio)

subtitled = VobSub(clip,"vts_01_0")
BilinearResize(subtitled,480,576)
        
Example 3:
#
# AVIsynth script for NTSC (no subtitles)
# by Jacob Laursen 
#
# Source: 720x480, 16:9 (anamorphic)
# Target: 480x480,  4:3 (letterboxed)
#

LoadPlugin("C:\WINNT\system32\mpeg2dec.dll")

video = mpeg2source("C:\DVD\movie.d2v")
audio = wavsource("C:\DVD\movie.wav")
clip  = audiodub(video,audio)

resized = BilinearResize(clip,480,360)
AddBorders(resized,0,60,0,60)
        
Example 4:
#
# AVIsynth script for PAL (with subtitles)
# by Jacob Laursen 
#
# Source: 720x576, 16:9 (anamorphic)
# Target: 480x576,  4:3 (letterboxed)
#
LoadPlugin("C:\WINNT\system32\mpeg2dec.dll")
LoadPlugin("C:\WINNT\system32\vobsub.dll")

video = mpeg2source("C:\DVD\movie.d2v")
audio = wavsource("C:\DVD\movie.wav")
clip  = audiodub(video,audio)

subtitled = VobSub(clip,"vts_01_0")
resized   = BilinearResize(subtitled,480,432)
AddBorders(resized,0,72,0,72)
        

Last update: Tuesday, 26-Feb-2002 21:43:58 CET