Sound sync problem with long file

Hi all,

I have an old movie which I have transferred first from VHS to DVD, then ripped into an MPEG-2 file. The rip is fine, there is no audio sync problem.

I then added a short 160 frame animation title, and after that, I inserted the movie itself. It has a framerate of 29 fps, according to Windows, but when I import it like that, the audio ends way before the video. I set it at 29.97, at which point the audio and video match fine. Audio scrubbing reveals that all is fine until the very end.

Then I render it using H.264 settings, and it gives me a nice video file, but there is a notable one second offset at the end. The movie is some 187K frames long, and the problem is definitely seen at 160K+ frames.

I have AV sync on. Could someone point to me what additional settings I should have to get the audio to match perfectly?

Many thanks!