[mythtv-users] MPEG2 -> MPEG2 Transcoding
Cory Papenfuss
papenfuss at juneau.me.vt.edu
Thu Mar 30 11:15:13 UTC 2006
>> The lossless mpeg2 cutting should clean them up. Then utils like
>> replex, dvb-replex, etc should be able to insert DVD NAV streams (by
>> demuxing or not)... then they're directly authorable.
>
> As far as I understood Geoffrey on the -dev list, remuxing will still
> potentially lead to bad sync for mythtranscoded mpeg2.
>
Due to bugs or cases where there are gaps in the audio stream as I
understand it. When ivtv cards hiccup, they fiddle with the video PTS to
fix it.... not the audio (I think).
> I have made the following observation: If I demux (mpeg2desc) and remux
> (mplex) an original ivtv recording, then it's perfectly in sync.
>
Like I said before, it works for 95% of the people 95% of the
time. Try capturing from a home video camera tape... I'll be you'll have
sync issues demuxing it like that. It will be fine at first, but after 2
hours or so, you'll likely have audio sync that's off by 10s of seconds.
Unless of course your video camera playback device has a broadcast-quality
TBC (time-base corrector.. not likely).
VHS captures also fairly likely to cause sync errors. The
problem is that the ivtv card expects to see *EXACTLY* 525 lines/frame at
29.97Hz, where each line lasts *EXACTLY* 1/15734s = 63.556us.
Consumer-grade tape devices have lots of jitter and produce craptastic
quality "NTSC" (or "PAL") signals. TV's don't mind if things get skipped
a bit, but realtime capture devices mind a lot and have to deal with it
somehow.
> If I do the same to a mythtranscoded mpeg2, I have to give an offset of
> -150ms to mplex.
>
The problem is not absolute sync. It's sync that *CHANGES*
throughout a capture. The only type of sync error that is even
acknowleged with the usual linux tools (mpeg2desc, mplex, transcode,
replex, etc, etc) are what you mention... a static XXXms offset. The
presentation timestamp that's part of the PS mux'd Audio and Video stream
fixes missing video/audio bits by adjusting them periodically in the
stream. If you demux a PS, you lose that information.... so when you
remux it you don't know that you're missing a video frame here or there.
The result is sync that gets worse throughout playback.
That's why the lossless mpeg2->mpeg2 has been so difficult to do.
Geoffrey parses the PS, compares the VTS/ATS, does some heuristics to
decide if something's changed, and then adjusts the remainder of the
stream to have a constant offset.... err something like that. Bottom line
is it cleans up the stream.
Oh... it also allows cutting, too... :)
-Cory
--
*************************************************************************
* Cory Papenfuss *
* Electrical Engineering candidate Ph.D. graduate student *
* Virginia Polytechnic Institute and State University *
*************************************************************************
More information about the mythtv-users
mailing list