Re: [Libav-user] Frame number

2012-07-03 Thread Jonas Elofsson
Hi, This is most helpful, thanks a lot! I whish I had more time for this project... Best regards, Jonas On Sat, Jun 30, 2012 at 3:12 AM, Michael Zucchi wrote: > > I'm pretty sure you shouldn't use approximate numbers (floats or doubles) > for this. > > There's a bunch of AVRational related and

Re: [Libav-user] Frame number

2012-06-29 Thread Michael Zucchi
I'm pretty sure you shouldn't use approximate numbers (floats or doubles) for this. There's a bunch of AVRational related and exact-precision arithmetic functions in libavutil for this purpose. see libavutil/mathematics.h libavutil/rational.h. On 29/06/12 21:51, Hector Alonso wrote: Hi,

Re: [Libav-user] Frame number

2012-06-29 Thread Hector Alonso
Hi, I've made myself one LibAvUtils class with this two functions implemented like this: int64_t LibAvUtils::frameNumberToPts(uint uiFrameNum, float fFps) { if (fFps <= 0) return 0; return (int64_t)uiFrameNum * (int64_t)(((float)AV_TIME_BASE) / fFps); } //---

Re: [Libav-user] Frame number

2012-06-29 Thread Kalileo
On Jun 29, 2012, at 15:00 , Jonas Elofsson wrote: > Hi, > > Thanks. I guess this means "pts"? > > I have no time to check again at the moment, but I did some tests with this > as well. > > The video I tested with reported 25 frames per second and the timebase 1/25. > Shouldn't this give me

Re: [Libav-user] Frame number

2012-06-29 Thread Jonas Elofsson
Hi, Thanks. I guess this means "pts"? I have no time to check again at the moment, but I did some tests with this as well. The video I tested with reported 25 frames per second and the timebase 1/25. Shouldn't this give me the pts 1,2,3,4... etc for each frame? Instead i got (if my memory serves

Re: [Libav-user] Frame number

2012-06-28 Thread Hector Alonso
Hi, you have to use the decoding or presentation timestamp and calculate it from the frame rate (time base of the stream). On Thu, Jun 28, 2012 at 10:09 AM, Jonas Elofsson wrote: > Hi, > > Resending this, it seems my first post never got through... > > I'm taking the first, trembling steps to us

Re: [Libav-user] Frame number

2012-06-28 Thread Nicolas George
Le primidi 11 messidor, an CCXX, Jonas Elofsson a écrit : > But, what I cannot find is a way to see what frame (displayed framenumber) > I just decoded. Coded framenumber I can see, but they are (of course) not > useable directly, and also are not available for all formats. Displayed > framenumber

[Libav-user] Frame number

2012-06-28 Thread Jonas Elofsson
Hi, Resending this, it seems my first post never got through... I'm taking the first, trembling steps to use FFMpeg in Qt, primary for a video editing SW. So far it is working good, I can decode frames to a QImage in Qt and display them on a label. Even video playback works good on a QLabel up to