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>
149 #ifdef VISP_HAVE_FFMPEG
153 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
158 unsigned int bit_rate;
161 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
162 cv::VideoWriter writer;
181 vpVideoFormatType formatType;
184 char fileName[FILENAME_MAX];
193 unsigned int frameCount;
196 unsigned int firstFrame;
227 #ifdef VISP_HAVE_FFMPEG
235 inline void setBitRate(
const unsigned int bitrate) {this->bit_rate = bitrate;}
248 #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54,51,110) // libavcodec 54.51.100
249 inline void setCodec(
const CodecID codec_id) {this->codec = codec_id;}
251 inline void setCodec(
const AVCodecID codec_id) {this->codec = codec_id;}
253 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
254 inline void setCodec(
const int fourcc_codec) {this->fourcc = fourcc_codec;}
257 void setFileName(
const char *filename);
258 void setFileName(
const std::string &filename);
265 #ifdef VISP_HAVE_FFMPEG
274 this->framerate = frame_rate;
276 #elif VISP_HAVE_OPENCV_VERSION >= 0x020100
284 inline void setFramerate(
const double frame_rate) {
285 this->framerate = frame_rate;
290 vpVideoFormatType getFormat(
const char *filename);
291 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)