Making and troubleshooting DVD videos from mpeg and avi sources

Mikademus

New member
Just thought I'd sum up what I have learned, perhaps it could help someone else.

-Mikademus



1.0) Purpose and procedure
-------------------------------------------------------------------------

1.1.0) Objective: Create a settop DVD player compatible Video-DVD from MPEG and AVI sources.


1.1.0) Basic procedure: Use TMPGEnc to convert source files into DVD compliant MPEG-1 or MPEG-2 streams. This includes resampling video into suitable size and framerate and audio into a proper sampling frequency. Use a DVD authoring program like TMPGEnc DVD Author to specify a DVD consisting of the converted files.


1.1.1) DVD compliancy and output format: If creating a widescreen DVD then the output format need to be MPEG-2, at least if you plan to use TMPGEnc DVD Author for DVD authoring.
For making PAL DVDs, use 25 frames per second (fps) for frame rate and any of these video resolutions: 352x288; 352x576; 704x576; or 720x576.
For NTSC DVDs, use a frame rate of 29.97 fps and any of these resolutions: 352x240; 352x480; 704x480; or 720x480.
The DVD-video standard specifies an sampling frequency for audio of 48 khz. Some players support other common frequencies, like 44.1 or 32 khz, but these will likely not work on many other standalone players.


1.1.2) Programs required:
VirtualDubMod for testing validity of AVI files' audio stream
Nandub for extracting invalid AVI audio streams
TMPGEnc for converting MPEG and AVI files to DVD compliant MPEG files
TMPGEnc DVD Author (recommended) for authoring DVD-videos.
DivX and XviD codecs. Do *NOT* use Nimo Codec Pack!



2.0) Issues:
-------------------------------------------------------------------------

2.1.0) Problem: MPEG generated from AVI source has no sound.

2.1.1) Solution: AVI source most likely has an invalid VBR header. Check is so with VirtualDubMod which will give you a popup complaining about this if so. If this is the case, then use Nandub to extract the audio as a wave file (File -> Save WAV), then use TMPGEnc with the original AVI file as video source and the extracted wav file as audio source to generate the mpeg file.



2.2.0) Problem: Audio/video out of sync in MPEG file created from AVI.

2.2.1) Solution: This is most commonly manifested as a linear progressive error where the sound is increasingly ahead of the video. The most likely cause of this problem is thrashed frames in the avi video stream which cause playback glitches only discernable during actual playback, which is why audio extraction or demultiplexing will result in a "more perfect" audio stream compared to the video stream. If you cannot get an error-free source, backup the source avi file and run it through DivFix's error check with "remove bad frames" switched on. The file should now be useable, but with visual and audial artifacts at the processsed frames' positions.



2.3.0) Problem: Audio/video out of sync in MPEG file created from a MPEG source.

2.3.0) Solution: Similat to 2.2.1, above, this is due to sync signals in the source stream which are lost when recoding audio, i.e. extracting it or resamling it for DVD compliance, or multiplexing the stream. The only way I have found to generally extract or convert the audio stream and retain audio/video syncronisation is to set TMPGEnc to use DirectShow for decoding. Raise the priority of DirectShow under environment settings -> VFAPI plugins to higher than the other alternatives. Note that using DirectShow to manipulate audio streams may result in poor quality or altogehter broken audio.

Further discussion and suggestions have been put forward at
http://forum.doom9.org/showthread.php?threadid=54615&highlight=vcd+sync
http://forums.afterdawn.com/thread_view.cfm/40101
http://www.dvdrbase.com/showthread.php?t=10651



2.4.0) Problem: Video of generated file is jerky.

2.4.1) Solution: Most likely you've recoded the source file into PAL framerate. The source files used are likely to be coded in 23.97 frames per second (fps), while PAL uses 25 fps and NTSC 29.97, which necessitated frame fills in the generated stream. Since PAL has higher resolution and lower framerate than NTSC, i.e. higher picture quality but lower animation quality, the frame fills, which are animation artifacts, becomes less frequent and in consequence much more perceptivly apparent then under NTSC's higher frame rate and lower resolution. If your DVD and TV can support it, generally prefer to output NTSC files than PAL.



2.5.0) Problem: TMPGEnc DVD Author uses an aspect ration or 4:3 even though the stream file is in 16:9.

2.5.1) Solution: You have converted the file into MPEG-1, TMPGEnc DVD Author only recognises 16:9 in MPEG-2 streams.



2.6.0) Problem: The AVI source appears fine in Windows Media Player (WMP) but the converted file has motion/compression distortions.

2.6.1) Solution: WMP uses DirectShow to render AVIs and this will resolve certain encoding issues. These distortions are apparent if viewed in some other players, like Nero ShowTime or source playback in VirtualDubMod, that uses other codecs or decoders than DirectShow. They are also visible in TMPGEnc's preview/output pane under default environmental settings. These distortions will propagate to the output file. This problem can be fixed in several ways depending on what software you have installed, I will provide three examples.

2.6.1.1) You can employ a program that uses DirectShow to filter and decode the AVI stream, I have found one program, MPEG4 Direct Maker (MP4DM), that succesfully reencode such AVIs to distortion-free mpeg files. However, MP4DM does not allow setting the maximum video bitrate and likely generate non-DVD conformant mpeg streams, why you must recode the result file with TMPGEnc to a proper MPEG stream. A consequence of these multiple recodings is that the resulting file will suffer from mild to severe quality degradation.

2.6.1.2) Alternatively, and perhpas preferably, set the priority of DirectShow to higher then the other alternatives in TMPGEnc's environmental settings -> VFAPI plugins. This will make TMPGenc employ DirectShow which will hopefully result in a correct video stream. However, there is also the risk that the audio stream will be corrupted. If so you'll need to extract the audio stream using another decoder in a separate pass and then multiplex the converted video and extracted audio.

[ 2.6.1.3) Thirdly, if using DirectShow in TMPGEnc degrades audio, use a program such as AVISynth where you can set decoders for video and audio streams separetly and set the video decoder to DirectShow and a non-DirectShow decoder for the audio stream. ]



2.7.0) Problem: An AVI file playable with (for instance) DivX Player, is not readable under TMPGEnc.

2.7.1) Solution: Some players use internal code to decode multimedia files, but TMPGEnc relies on codecs installed on the system. You do not have the correct codecs installed. If the file playes under WMP you could have TMPGEnc use DirectShow for decoding, otherwise you must determine which codec you need, for instance using VirtalDubMod (File -> File information), and obtain and install that codec. If you *have* DivX and XviD and still can't open certain AVIs there's the risk that those files have been coded using certain DivX3 codecs now considered illegal. They can still be obtained but are not recommended since they are known problem sources.
 
Last edited:

Aenea

New member
Mikedemus

You are a fabulous individual, do ya know that?

This is of trememdous help. Thank you.
 

McBootNatch

New member
Thanks. When converting with TMPGEnc the video shown while converting is very small. Is that the same size it will appear on the result video (if so, how can I make it larger without going over the 4.7 gig DVD limit)?

~EDIT~
Just noticed that the size is 352 x 480 pixels, yet the filesize is juuuuust under the amount allowed on a DVD-R (4.7 gigs) How would I reduce this without having the movie be too small? Thanks again
 
Last edited:
@Mikademus just noticed your tut, and thank you for sharing the knowledge you have gained here and else where... :)
 

Mikademus

New member
I just returned to this forum after a few months and I am very, very happy to see that it appears that I've helped people, and that my post/tutorial has become a popular thread! Thank you, everyone, for your kind comments!
 

SON"o"CATWEAZLE

New member
nice one

yeh great tutorial m8, answred a problem ive been having for--- well since i started messin about with DV etc really, a cupla months ago.
ive saved it to pdf for future ref ;)

cheers

S"o"S
 
Top