43 #ifndef vpVideoWriter_H
44 #define vpVideoWriter_H
48 #include <visp3/io/vpImageIo.h>
49 #include <visp3/io/vpFFMPEG.h>
51 #if VISP_HAVE_OPENCV_VERSION >= 0x020200
52 # include <opencv2/highgui/highgui.hpp>
53 #elif VISP_HAVE_OPENCV_VERSION >= 0x020000
54 # include <opencv/highgui.h>
166 #ifdef VISP_HAVE_FFMPEG
170 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
175 unsigned int bit_rate;
178 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
179 cv::VideoWriter writer;
198 vpVideoFormatType formatType;
201 char fileName[FILENAME_MAX];
210 unsigned int frameCount;
213 unsigned int firstFrame;
244 #ifdef VISP_HAVE_FFMPEG
252 inline void setBitRate(
const unsigned int bitrate) {this->bit_rate = bitrate;}
265 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
266 inline void setCodec(
const CodecID codec_id) {this->codec = codec_id;}
268 inline void setCodec(
const AVCodecID codec_id) {this->codec = codec_id;}
270 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
271 inline void setCodec(
const int fourcc_codec) {this->fourcc = fourcc_codec;}
274 void setFileName(
const char *filename);
275 void setFileName(
const std::string &filename);
282 #ifdef VISP_HAVE_FFMPEG
291 this->framerate = frame_rate;
293 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
301 inline void setFramerate(
const double frame_rate) {
302 this->framerate = frame_rate;
307 vpVideoFormatType getFormat(
const char *filename);
308 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)