2 #include <Utils/Param.hh>
3 #include <Utils/IOUtils.hh>
4 #include <VideoSink/VideoSink_FFmpeg.hh>
9 int main(
int argc,
char** argv) {
14 "path to the result video file",
"result.mkv",
'o');
17 "path to image list",
"",
'i');
19 bool* losslessCoding = params.
AddParamBool(
"lossLessCoding",
"choose loss less video coder",
false);
22 if (!IOUtils::ParseCommandLineEvalHelp(params, argc, argv))
25 vector<string> imageNames;
27 if (Param::ParseListFile(*imageList, imageNames) != 0) {
28 BIASERR(
"error: loading list " << *imageList << endl)
31 cout <<
"loaded image list: " << *imageList << endl;;
37 if (ImageIO::Load(imageNames[0],image)!=0) {
38 BIASERR(
"could not load first image from list")
42 encoder.SetSize(image.GetWidth(),image.GetHeight());
44 if (*losslessCoding) {
50 int res = encoder.
Open(*videoFile);
void SetEncoder(enum CodecID codecId)
Set encoder.
Video encoding using FFmpeg library.
int AddFrames(std::vector< std::string > filenames)
Load each Image from a list of files and add them to the video output file.
bool * AddParamBool(const std::string &name, const std::string &help, bool deflt=false, char cmdshort=0, int Group=GRP_NOSHOW)
int Open(std::string filename)
Open a file for video output and init the codec.
This class Param provides generic support for parameters.
std::string GetError()
Get the last error message.
std::string * AddParamString(const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)