51 #include <visp/vpImageIo.h>
56 #ifdef VISP_HAVE_FFMPEG
63 # ifndef __STDC_CONSTANT_MACROS
64 # define __STDC_CONSTANT_MACROS
76 # define INT64_C(c) (c ## LL)
79 # define UINT64_C(c) (c ## ULL)
87 #include <libavcodec/avcodec.h>
92 struct AVFormatContext;
93 struct AVCodecContext;
162 unsigned long frameNumber;
164 AVFormatContext *pFormatCtx;
165 AVCodecContext *pCodecCtx;
171 SwsContext *img_convert_ctx ;
172 unsigned int videoStream;
175 std::vector<int64_t> index;
179 bool streamWasInitialized;
181 vpFFMPEGColorType color_type;
186 uint8_t *outbuf, *picture_buf;
192 unsigned int bit_rate;
194 bool encoderWasOpened;
195 double framerate_stream;
196 int framerate_encoder;
225 return framerate_stream;
243 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
244 bool openEncoder(
const char *filename,
unsigned int width,
unsigned int height, CodecID codec = CODEC_ID_MPEG1VIDEO);
246 bool openEncoder(
const char *filename,
unsigned int width,
unsigned int height, AVCodecID codec = AV_CODEC_ID_MPEG1VIDEO);
248 bool openStream(
const char *filename,vpFFMPEGColorType color_type);
257 inline void setBitRate(
const unsigned int rate) {this->bit_rate = rate;}
263 inline void setFramerate(
const int framerate) {framerate_encoder = framerate;}
void setBitRate(const unsigned int rate)
double getFramerate() const
error that can be emited by ViSP classes.
unsigned long getFrameNumber() const
This class interfaces the FFmpeg library to enable video stream reading or writing.
void setFramerate(const int framerate)