Download and install Mediacoder V0.3.9
Install necessary codecs. (I have found K-Lite Codec Pack to be most complete)

Start Mediacoder

Add the DivX or XviD avi file to be converted to DVD Compliant MPEG2 by clicking <Add file> and selecting the file to be added or by dragging the file to

Mediacoder.

Specify the Output Folder (on Right side of the top menu icons)

Double click on the avi file name inside Mediacoder. The file would play using Mplayer. This would confirm that proper codecs are available for decoding the

avi file and permit conversion. It will show the file details in the <Summary> window.(Or MediaInfo can be used to gather the information)

From the avi file details, decide now on the following:-

DVD Type(NTSC or PAL) to be created:- If you wish to stick to the original frame rate of the avi file then for 25fps it will be PAL, for 23.976fps it will be

NTSC. (If you wish to use a different system from the original frame rate then calculations for letterboxing will change, I am coming to that later)

Aspect ratio:- Use a calculator to calculate the aspect ratio of the avi by dividing Width(W) by height(H). Any figure equal to or more than 1.78 means that

the aspect ratio is 16:9. Otherwise, it is 4:3 (If you collect avi info using MediaInfo, this program directly tells you what aspect ratio is to be used)

Calculate Letterboxing(top & bottom black bands) height(H1):-
PAL 4:3 : [576 - (720/W)xH]/2
PAL 16:9 : [576 - (1024/W)xH]/2
NTSC 4:3 : [480 - (720/W)xH]/2
NTSC 16:9 : [480 - (853/W)xH]/2
Let us call this figure H1



Click on <Audio> to open audio coding selection window.
Source : is automatically selected to be Mplayer.
Encoder : Select FFMPEG Audio Codecs, if the original audio is something other than 48KHz, MP2 or AC3 Audio. If it is already 48KHz MP2 or AC3(2 or 5.1

Channel) DVD compliant audio then you can use Stream Copy selection. If FFMEG Audio Codec is selected, then on the Right window, select FFMPEG and next

select AC3 or MPEG Layer 2 and the bitrate. I have found that a bit rate of 192 KBps is ample for stereo audio.
Resample: Select original, if it is already 48KHz audio. If not then select 48000 Hz.
Gain : Depending on the original volume, one may wish to increase / decrease the volume in the produced DVD. Select by experiment.
Down Mix: I leave it Disabled
Leave other selections alone.


Click on <Video> to open the video coding selection window.
Bitrate: Select by experimentation, depending on how much you wish to fit on one 4.38GB DVD-R.
Rate Mode: I have not noticed much quality difference between the different selections and stick to Fixed Bitrate. You can experiment.
Format: Select MPEG-2
Bitrate Control:Leave at Default


Click on <Container>
Container Format: Select MPEG Option : Opens another window. Select MPEG Options->Format->PAL DVD or NTSC DVD as required.

Click on <Picture>
Resize Video: Select the Resize Video. Write the picture size 720xH2 in the space provided (For D1 DVD, the width is always 720). Calculate H2 (unletterboxed

height) as [576 - 2H1] for PAL, [480-2H1] for NTSC. H1 is the letterboxing height calculated earlier.
Crop Video: Do not select
Rotation : Disabled
Frame Rate: For NTSC DVD, select 23.976. For PAL select 25
Do not select any of the remaining items.


We need to do a few further settings before starting the encoding. This is done through clicking on the Settings menu on top.

Click on the "Settings" menu icon on top.
A small <Settings> window opens.

Select Video Codecs
Select FFMPEG
Select Force Aspect Ratio
Select Value in the selection at bottom 4:3 or 16:9 as earlier decided for the DVD aspect ratio and click <Apply>


Select Video Filters and choose Expanding:-
If there is no letterboxing required, then select the Value = No
If letterboxing is required, then select the Value= Yes plus following:-
Width: Write 720 in the Value window and click <Apply>
Height: Write 576 for PAL, 480 for NTSC and click <Apply>
X Position: Leave at 0 in the Value window and click <Apply>
Y Position: write the figure H1 (calculated earlier) in Value window and click <Apply>.

Finally click <OK>, This will close the <Settings> window.


Now all the settings needed are complete for encoding the avi to a D1 DVD compliant MPEG2 file.

Click on "Start" icon on top. The encoding of the avi file starts and another small window opens on right side of the Mediacoder Window showing various

encoding parameters. In addition, two horizontal progress bars, "Current Task" and Total Tasks" show progress of the ongoing encoding.


ADDITIONAL:-

PAL DVD from 23,976fps avi.
Carry out all calculations and settings as per PAL DVD creation, even if the avi file is 23.976fps. The picture requires letterboxing black bands on top and

bottom. Calculate H1 and H2 and apply at the proper places in the Settings.

NTSC DVD from 25fps avi.
I generally avoid it since it requires putting black vertical bands on left and right of the video. If someone really needs it, then I will explain the calculations in future.