Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 1997 11:16:29 +0200 (EET)
From:      Petri Helenius <pete@sms.fi>
To:        Randall Hopper <rhh@ct.picker.com>
Cc:        Amancio Hasty <hasty@rah.star-gate.com>, multimedia@FreeBSD.ORG
Subject:   MPEG audio/video sync & Re: These mtv video pauses are murder
Message-ID:  <199712220916.LAA22145@silver.sms.fi>
In-Reply-To: <19971221225947.08124@ct.picker.com>
References:  <19971221222047.08726@ct.picker.com> <199712220329.TAA00402@rah.star-gate.com> <19971221225947.08124@ct.picker.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Randall Hopper writes:
 > 
 > Say, something I've been meaning to ask you and the group.  Is there
 > something in the MPEG system stream format that you know of which allows
 > you to "attach" (or suggest a relation) between a particular point in the
 > video and the audio streams.  Or is that implicit in the interleaving.

MPEG system stream contains "PTS"s which stands for "Presentation Time
Stamp". I cannot recall from top of my head at which point the data
should be going at the same time when the PTS hits. It's either the
last or the first byte of the pack and it was supposed to either play
back or enter the decoder at the time of PTS. I've to check the spec.
 > 
 > What I'm a little concerned about is that for longer recordings, without
 > these attachments, the strea audio will likely slip out of sync with the
 > video during playback (due to a dropped frame or two per second [or more]
 > in the original recording).  Fxtv does try to buffer the video stream so
 > that it's 30fps, regardless of how many frames it had to skip during
 > capture, but if this process is off by, for example let's say, 1 frame per
 > second, after 30 seconds the audio is going to be out of sync with the
 > video by 1 second.  It's accuracy is better than that, but I know it's not
 > perfect.
 > 
 > If this is possible to address, I'd like to look at it for the next batch
 > of mods.
 >
It's possible to address, however doing PTS's is not a perfect way
since some decoders drop or fill in frames to keep the sync. However,
it's much better than no sync at all.

 > Really, its kind of a nutty process that goes on now because of the tools
 > that are available.  First fxtv writes a RAW capture file that has the
 > audio/video interleaved (so we know the audio/video relationship).  Then we
 > separate those out into separate audio and video streams (video padded up
 > to 30fps) so mpeg_encode can be used to build an MPEG video stream, and
 > mpeg_audio can be used to encode an MPEG audio stream.  Finally those
 > streams are merged together with mplex into a MPEG system stream, where we
 > hope the video still "lines-up" with the audio.
 > 
I think carrying the timestamps trough the elementary stream phase
might be difficult.

Pete



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199712220916.LAA22145>