timestamp calculation
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)? Thank You,Chau Pham.
I would like to do the opposite of you.... from the timestamp calculate the pts.... if you figure out please let me know... On Wed, Aug 29, 2012 at 10:33 PM, Chau Pham <chaupv79@hotmail.com> wrote:
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)? Thank You,Chau Pham. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Hi Wagner, I got this information below via debugging for generating thumbnail, option : -r 1/5 (generate thumbnail in every 5 seconds) I printf out pts, dts, duration information from AVPacket.pts = 10350000, dts = 10350000, duration = 450000. time=00:02:00.00, the timestamp that shows in progress of thamnail generating. 5 seconds ~ 450000 -> 1 second = 90000 ( I don't know the principle on calculating timestamp) AV_TIME_BASE = 1000000. if I convert timestamp base on AV_TIME_BASE, then number of seconds = pts/AV_TIME_BASE= 10.35 seconds.then tamstamp shoud be : 00:00:10.035 => 00:02:00.00(60 seconds) different to 10.35 seconds Could anyone explain this? Thank you,Chau Pham. > From: wagner.patriota@gmail.com
Date: Wed, 29 Aug 2012 23:08:35 -0300 To: ffmpeg-user@ffmpeg.org Subject: Re: [FFmpeg-user] timestamp calculation
I would like to do the opposite of you.... from the timestamp calculate the pts.... if you figure out please let me know...
On Wed, Aug 29, 2012 at 10:33 PM, Chau Pham <chaupv79@hotmail.com> wrote:
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)? Thank You,Chau Pham. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Chau Pham <chaupv79 <at> hotmail.com> writes:
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)?
pts is the presentation timestamp that you probably ask for. You have to scale it with the timebase to get seconds. Carl Eugen
Hi Carl, I figure out how to calculate timestamp, I know pts, duration in AVPacket, totol seconds = pts/90000 + duration/90000; then i format timestamp in hh:mm:ss from total seconds. regards,Chau Pham
To: ffmpeg-user@ffmpeg.org From: cehoyos@ag.or.at Date: Thu, 30 Aug 2012 07:10:23 +0000 Subject: Re: [FFmpeg-user] timestamp calculation
Chau Pham <chaupv79 <at> hotmail.com> writes:
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)?
pts is the presentation timestamp that you probably ask for. You have to scale it with the timebase to get seconds.
Carl Eugen
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Chau Pham <chaupv79 <at> hotmail.com> writes:
I know pts, duration in AVPacket, totol seconds = pts/90000 + duration/90000
Don't forget that not every stream has timebase == 90000. Please do not top-post here, Carl Eugen
To find the timebase where you were originally were hard coding 90000, look here stream.time_base().den() when checked while using an mp4 file, it would return 90000. -- View this message in context: http://ffmpeg-users.933282.n4.nabble.com/timestamp-calculation-tp4653031p467... Sent from the FFmpeg-users mailing list archive at Nabble.com.
Hi Everybody, Suppose that I know AVPacket element: pts, dts, duration How could I calculate the timestamp (hh:mm:ss:MMM)? Thank You,Chau Pham.
I know within libavfilter you can use methods like av_ts2str/av_ts2timestr ref: https://github.com/FFmpeg/FFmpeg/blob/master/libavfilter/af_ashowinfo.c
participants (5)
-
Carl Eugen Hoyos -
Chau Pham -
d1820 -
Roger Pack -
Wagner Patriota