[Live-devel] presentationTime and B-Frames
Ross Finlayson
finlayson at live555.com
Sat Jun 30 00:34:21 PDT 2007
>Content-Type: multipart/signed; protocol="application/x-pkcs7-signature";
> micalg=sha1; boundary="------------ms050109060700050902090703"
>
>Hi!
>
>I'm transcoding MPEG-2 (with B-Frames) into MPEG-4 (without
>B-Frames, just I and P). Currently I'm just transcoding video, but
>later the transcoded streams should by able to be synchronised with
>the source's audio stream:
>
>
> --------> Audio --------------------------------
> | |
>------------ ------
>| Source | | Sink |
>------------ ------
> | ------------ |
> --------> Video ---------> | Transcoder | ------
> ------------
>
>The problem is setting the timestamps correct. Right now I generate
>them when a frame enters the encoder. But then I lose the
>information of the incoming frame and won't be able to sync to audio
>later on, right?
>
>When I just pass the times through by setting fPresentationTime =
>presentationTime, the transcoded streams "flickers" as if the frames
>are presented in the wrong order.
>
>Is there a possibility to set the presentation times in a way
>without losing the ability to sync to the corresponding audio stream?
Note that In your original MPEG-2 stream, with B-frames, the frames
will be in decoding order, which is different from the display order,
and thus different from the order of frames in the resulting MPEG-4
stream (because that doesn't have B frames). In particular, the
presentation times in the original MPEG-2 stream, with B-frames, will
*not* be monotonically increasing. You will need to reorder the
presentation times accordingly when you convert the stream to MPEG-4
(without B-frames).
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list