[Libav-user] Updated libav/ffmpeg tutorial

wm4 nfxjfg at googlemail.com
Tue Mar 3 16:06:15 CET 2015


On Tue, 3 Mar 2015 18:01:12 +0300
Max Vlasov <max.vlasov at gmail.com> wrote:

> On Tue, Mar 3, 2015 at 2:47 PM, wm4 <nfxjfg at googlemail.com> wrote:
> 
> > On Tue, 3 Mar 2015 12:27:51 +0300
> > Max Vlasov <max.vlasov at gmail.com> wrote:
> >
> > >
> > > It turns out that it is just a get accessor for best_effort_timestamp
> > field
> > > and the corresponding set accessor (av_frame_set_best_effort_timestamp)
> > is
> > > called twice (in avcodec_decode_video2 and in avcodec_decode_audio4) in
> > the
> > > utils.c with a similar lines
> >
> > As I said, it's only a helper. What you really should do is always
> > using the PTS, and if the PTS is not available, use the DTS. The extra
> > heuristics are useful only for broken files and such; and they can be
> > better than what best_effort_timestamp does.
> >
> >
> 
> You probably mean pkt_pts, pkt_dts from the frame, right? At least I see
> that this values used by this simple function (guess_correct_pts) as
> incoming data for comparison. And also quick test shows that
> best_effort_timestamp is equal to (if pkt_pts valid then pkt_pts else
> pkt_dts) value most of the time.

Yes.

> I also see that guess_correct_pts is the mutating function relying on the
> statistics of decoding which might be different for different seek/play
> scenarios.
> 
> So it looks like best_effort_timestamp not so great after all, but It's
> strange that no simple function was implemented so far to implement this
> simple conditional (pkt_pts first, pkt_dts next).

Maybe because it's trivial. There are worse things in libav* APIs.


More information about the Libav-user mailing list