47 #include <visp3/io/vpImageIo.h>
52 #ifdef VISP_HAVE_FFMPEG
59 # ifndef __STDC_CONSTANT_MACROS
60 # define __STDC_CONSTANT_MACROS
72 # define INT64_C(c) (c ## LL)
75 # define UINT64_C(c) (c ## ULL)
83 #include <libavcodec/avcodec.h>
88 struct AVFormatContext;
89 struct AVCodecContext;
158 unsigned long frameNumber;
160 AVFormatContext *pFormatCtx;
161 AVCodecContext *pCodecCtx;
167 SwsContext *img_convert_ctx ;
168 unsigned int videoStream;
171 std::vector<int64_t> index;
175 bool streamWasInitialized;
177 vpFFMPEGColorType color_type;
182 uint8_t *outbuf, *picture_buf;
188 unsigned int bit_rate;
190 bool encoderWasOpened;
191 double framerate_stream;
192 int framerate_encoder;
221 return framerate_stream;
239 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
240 bool openEncoder(
const char *filename,
unsigned int width,
unsigned int height, CodecID codec = CODEC_ID_MPEG1VIDEO);
242 bool openEncoder(
const char *filename,
unsigned int width,
unsigned int height, AVCodecID codec = AV_CODEC_ID_MPEG1VIDEO);
244 bool openStream(
const char *filename,vpFFMPEGColorType color_type);
253 inline void setBitRate(
const unsigned int rate) {this->bit_rate = rate;}
259 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)