View Single Post
Old 23rd November 2011, 19:44   #1  |  Link
Mai
Registered User
 
Join Date: Apr 2006
Posts: 3
Odd mpeg2 + dts sync problems on reencode

Hi @ all

sorry for the title but I cannot think of a really fitting one because I don't know where the actual problem lies (hopefully we can figure this out). Also this might not be the right sub-forum I wasn't sure of that either. I did a search but as I cannot figure out a title for my own so I couldn't guess what others might have called their thread ...

Ok, this is all part of a longer story but I figure the interesting part goes like this:

My source is an NTSC DVD, which I got in elementary streams on my hdd. The two of interest are the video (orig.m2v from here on) and the sound (sound.dts). My processing pipeline for the video is: orig.m2v->AviSynth->TMPGEnc->filtered.m2v. (My avs does not do frame rate conversion, but only a AssumeFPS("ntsc_film") which sould not change anything considering the source.) So I did that and got new.m2v, then I used ffmpeg to mux sound.dts and new.m2v into new.mpg. While playing I noticed, that the sound is dead on at the beginning, and about 1-2 sec. off at the end of new.mpg (~115 min running time).

So I said: ok maybe something went wrong while reading the input in the avs. So I opened new.m2v and orig.m2v, each directly in VDubMod (using it's internal decoder). Then I skipped to some frame in the end and checked if this frame was the same in both: it was -> so as far as I can see no frame was dropped or duplicated, new.m2v and orig.m2v are picture for picture identical.

My next guess was that on obtaining the orig.m2v and sound.dts something went wrong. So I remuxed sound.dts and orig.m2v using ffmpeg into orig.mpg. If I play this the sound is in sync perfectly.

Both, orig.m2v and new.m2v are progressive and are encoded in such a way that the 3:2 pull-down is done on playback. And as far I understand the frame rate for an m2v cannot be chosen randomly, there are only well defined ones available, or am I wrong here? Also where should this 2 sec. error in 115min of film come from? Could this be some wired pull down related thing?

What I did then do was a mpgtx -i on both:
------------------------------------------------
orig.m2v
Mpeg 2 Video File
Estimated Duration: 01:27:18.92s
Aspect ratio 16/9 (large TV)
Interlaced, chroma format: 4:2:0
Size [720 x 480] 29.97 fps 9.80 Mbps

mpgtx -i new.m2v
Mpeg 2 Video File
Estimated Duration: 01:26:06.29s
Aspect ratio 16/9 (large TV)
Interlaced, chroma format: 4:2:0
Video Format: NTSC
Size [720 x 480] 29.97 fps 8.00 Mbps
------------------------------------------------

One can easily see the difference in the duration. Well it's estimated, but a whole minute? -> also this does not fit the 1-2 sec error I have, thus might be unrelated. Then there is this additional line saying "NTSC" for new.m2v?

I did another thing: pipeline same as above, but with x264 at the end. Then I muxed the resulting new_264.mp4 together with sound.dts into new_264.mkv using ffmpeg again. Playing this resulted in the same sync problems.

I'm pretty baffled, because I don't know enough of the internals of mpeg to get my head around this. Does somebody have any idea? The only other thing I can think of is removing like 30 or so frames across the 115 minutes, that doesn't sound right...

Thanks for any suggestions
Cheers
Mai is offline   Reply With Quote