[FFmpeg-devel] print pts as min:sec

Moritz Barsnick barsnick at gmx.net
Wed Jun 26 13:26:33 EEST 2019


On Tue, Jun 25, 2019 at 23:13:51 +0200, Ulf Zibis wrote:
> is there a functionality in the ffmpeg library to print AVFrame pts
> values in respect to AVRational time_base in human readable form?

This list is for the development *of* ffmpeg and its libraries. For the
use of the libraries and the development *with* them, please turn to
the mailing list "libav-user".

Regarding your request, you can look at libavfilter/vf_showinfo.c.
filter_frame() has an av_log() line which should show the calculation
you are looking for:

    av_log(ctx, AV_LOG_INFO,
           "n:%4"PRId64" pts:%7s pts_time:%-7s pos:%9"PRId64" "
    [...]
    av_ts2str(frame->pts), av_ts2timestr(frame->pts, &inlink->time_base), frame->pkt_pos,

Moritz


More information about the ffmpeg-devel mailing list