From a2254447b138af7fc0719e5a107816487255736b Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 8 Aug 2013 13:32:46 +0100 Subject: basic speed control for video_loader --- rotord/src/libavwrapper.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rotord/src/libavwrapper.h') diff --git a/rotord/src/libavwrapper.h b/rotord/src/libavwrapper.h index 4c5cb02..ebe47c1 100755 --- a/rotord/src/libavwrapper.h +++ b/rotord/src/libavwrapper.h @@ -29,6 +29,10 @@ //http://blog.tomaka17.com/2012/03/libavcodeclibavformat-tutorial/ //great to use c++11 features + +//http://dranger.com/ffmpeg/ +//the mnost up to date tutorial? + #ifndef UINT64_C #define UINT64_C(c) (c ## ULL) #endif @@ -103,6 +107,7 @@ namespace libav { int getNumberOfFrames() const; int getWidth() const; int getHeight() const; + float getFrameRate() const{return framerate;}; int getNumberOfChannels() const; bool readNextFrame(int targetFrameIndex = 0); bool readNextFrameWithPacket(int targetFrameIndex, AVPacket& packet, AVFrame* pYuv); @@ -116,6 +121,7 @@ namespace libav { int videoStream; int previousFrameIndex; bool isOpen; + bool open(std::string& fileName, enum PixelFormat formatParam = PIX_FMT_RGB24); bool open(char* fileName, enum PixelFormat formatParam = PIX_FMT_RGB24); @@ -138,6 +144,9 @@ namespace libav { size_t numBytes; int numFrames; int sc; // number of color channels + float framerate; + //NB representing framerate as a float implies that + //ABOVE ~93 HOURS AT 25FPS the calculations will be inaccurate }; -- cgit v1.2.3