47 #ifndef vpVideoWriter_H
48 #define vpVideoWriter_H
52 #include <visp/vpImageIo.h>
53 #include <visp/vpFFMPEG.h>
55 #if VISP_HAVE_OPENCV_VERSION >= 0x020200
56 # include <opencv2/highgui/highgui.hpp>
57 #elif VISP_HAVE_OPENCV_VERSION >= 0x020000
58 # include <opencv/highgui.h>
153 #ifdef VISP_HAVE_FFMPEG
157 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
162 unsigned int bit_rate;
165 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
166 cv::VideoWriter writer;
185 vpVideoFormatType formatType;
188 char fileName[FILENAME_MAX];
197 unsigned int frameCount;
200 unsigned int firstFrame;
231 #ifdef VISP_HAVE_FFMPEG
239 inline void setBitRate(
const unsigned int bitrate) {this->bit_rate = bitrate;}
252 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
253 inline void setCodec(
const CodecID codec_id) {this->codec = codec_id;}
255 inline void setCodec(
const AVCodecID codec_id) {this->codec = codec_id;}
257 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
258 inline void setCodec(
const int fourcc_codec) {this->fourcc = fourcc_codec;}
261 void setFileName(
const char *filename);
262 void setFileName(
const std::string &filename);
269 #ifdef VISP_HAVE_FFMPEG
278 this->framerate = frame_rate;
280 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
288 inline void setFramerate(
const double frame_rate) {
289 this->framerate = frame_rate;
294 vpVideoFormatType getFormat(
const char *filename);
295 static std::string getExtension(
const std::string &filename);
void setBitRate(const unsigned int bitrate)
unsigned int getCurrentFrameIndex() const
void setFirstFrameIndex(const unsigned int first_frame)
void setCodec(const AVCodecID codec_id)
Class that enables to write easily a video file or a sequence of images.
This class interfaces the FFmpeg library to enable video stream reading or writing.
void setFramerate(const int frame_rate)