[vlc-devel] How to write a encoder/decoder plugin for VLC?

Alex Lee alex.q.lee at gmail.com
Mon Mar 16 14:59:11 CET 2009

Hi Remi,

Sorry for late response. [?]

I saw some documents on videolan.org and find this in the following address:


"Presentation Time Stamps located in the system layer of the
stream are passed to the decoders, and all resulting samples are
dated accordingly. The output layers are supposed to play them at
the right time. Dates are converted to microseconds ; an absolute
date is the number of microseconds since Epoch (Jan 1st, 1970).
The mtime_t type is a signed 64-bit integer. "

Do you know how to comute PTS value? I see this modules/codec/theora.c :

    p_sys->i_pts += ( INT64_C(1000000) * p_sys->ti.fps_denominator /
                      p_sys->ti.fps_numerator ); /* 1 frame per packet */

But what PTS should be for variable frame rate stream?


On Sat, Mar 14, 2009 at 12:35 AM, Rémi Denis-Courmont <remi at remlab.net>wrote:

> On Fri, 13 Mar 2009 21:57:41 +0800, Alex Lee <alex.q.lee at gmail.com> wrote:
> > I noticed that there are both decoder and encoder interface for theora
> in
> > modules/codec/theora.c.
> >
> > Does it enough for me to write a module like this to complete the work of
> > transcoding?
> Yes. The transcode module takes care of the decoder->encoder interfacing.
> > Do I need to worry about the A/V synchronization of the output stream? I
> > have no idea about how to transcode one stream to another format while
> keep
> > A/V synchronized int the output stream.
> You need to maintain consistent PTS values.
> --
> Rémi Denis-Courmont
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090316/b5b2b2ca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 330.gif
Type: image/gif
Size: 96 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090316/b5b2b2ca/attachment.gif>

More information about the vlc-devel mailing list