Dropped Frames and Timestamps
An MPEG-2 program stream (VOB, TS, MPG or MPEG) consists of many small video and audio packets. Each of these packets (amongst other information) has its own time-stamp.
So when an MPEG program stream gets played back, it doesn’t really matter if a video or audio packet is missing. With the help of the timestamps, it is easy to play the right audio snippet with the corresponding video.
Prior to the encoding process, video, audio, and sometimes subtitles get ripped apart and end up in individual elementary streams. During this process the timestamps are lost. They wouldn’t help a lot anyways, as the DivX target container is AVI and AVI doesn’t support time stamps.
The process for re-encoding audio and video streams is done sequentially. Note by note, and picture by picture.
In the original video stream (before the encoding process began), if a frame was missing, the corresponding packet from the audio stream was skipped. Now, with the lack of timestamps, the audio packet would no longer be skipped and a small shift in the audio would result.
If an audio chunk missing, it would have simply resulted in a clicking sound, or a short lack of audio in the original file. Now, that too will result in a small audio shift after the encoding process.
As video packets are larger than audio packets, they do get tend to be dropped more often than audio packets. This is especially true for TV captures.
It should be emphasized that the original video will play back fine and you won’t notice all these small errors. But the more small errors there are in the source, the more noticeable the audio/vido sync will be after you convert it to the DivX format.
If your problems are caused by the above reasons, trying to correct them after the encode has happened, is nearly impossible.
So what can you do about this?
You should probably shy away from trying to convert a file that is a copy (of a copy of a copy sometimes). This can often be the case with online content.
Chances are, your MPEG-2 content will have a dropped video frame here, or an audio packet there. What you can do, is demux your mpg content with a demuxer that automatically compensates for missing audio and video packets. This way, you have elementary video and audio streams that have already compensated for missing packets. After doing this, you can convert the video to divx and the audio to mp3, and then re-mux it back together.
This is a more advanced process than simply dropping the files into DivX Converter. Kamiwa has actually provided a very helpful tool for helping you get started with this. It is called "Kamiwa's Batch Encoder". If you use it right, it will actually demux your content, convert it to divx, and mux it into an AVI container. The download and detailed instructions are located at his website here.
For more information, you can visit these resources:
- Printer-friendly version
- 5362 reads
