Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am currently transcoding video data from a Video DVD to x264 MP4 files, but the original MPEG-2 streams seem to have some strange problems. This video DVD is of a home-made digital TV recording (DVB-S) using a PVR, and subsequently burned to a standard DVD-R. The recorded programmes play back flawlessly in my standalone DVD player.

After checking one of the transcoded MP4 files, I noticed that at certain points—always the same frames, irrespective of the range of the original video I'm encoding—there is a weird stutter in the video. One frame freezes for about a second. The number of frames remains correct so there is no audio sync issue, it is just that about 20 frames are replaced by duplicates of one specific frame. This seems to happen regardless of the software I use. I have tried Avidemux 2.6.3 with native MPEG-2 decoding or serving frames through Avisynth 2.6.0, and also VirtualDub 1.9.11 with the MPEG-2 plugin. All three methods introduced the same number of duplicates of the same frame at the same position every time.

Examining the source VOB, I checked this specific section of the stream and noticed that there is a slight stutter in playback too (tested using Windows Media Player, VideoLAN, MPlayer, and AviDemux' internal preview), but it is not the exact same freeze. It happens about a second earlier in the stream than in the transcoded file, and freezes for about half as long (~10 frames). This also happened irrespective of whether I played the original video directly from the DVD-R or after copying the VOB file to hard disk, so it's not the drive that's at fault.

Following the suggestion of a friend, I demultiplexed the VOB into its elementary M2V and AC3 streams, and then directly remultiplexed the two into a new MPEG-PS file. Indeed, the stutter disappeared from both direct playback of the remuxed file, and the transcodes that I generate from it.

So, the symptom of the problem is solved, but I wonder why simply demuxing and remuxing the original video was enough? Is some sort of index being rebuilt in the process, solving a problem inherent to the original data? But then, why is the freeze different after transcoding, even across different decoders and encoders; and why do I notice no freeze when playing it back on a standalone TV DVD player?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.