[FFmpeg-devel] Converting pts to human-readable timestamp

Michael Niedermayer michaelni at gmx.at
Mon Dec 19 04:45:42 CET 2011


On Sun, Dec 18, 2011 at 10:54:29PM +0200, Yuval Adam wrote:
> (I apologize for the new thread, don't have the old one [1] to continue
> from)
> 
> Continuing Michael's suggestion in using pkt->pts in order to use in the
> output filename of img2, I'm trying to convert it to some human-readable
> format.
> This is what I have so far [2]:
> 
> int64_t ts = av_rescale_q(pkt->pts, codec->time_base, AV_TIME_BASE_Q)
> / AV_TIME_BASE;

there are multiple timebases, this is the wrong one
the correct one is in AVStream s->streams[x]


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111219/65ef37d1/attachment.asc>


More information about the ffmpeg-devel mailing list