stuff-from-scratch/test/video/TestVideoDecoder.cpp
2022-10-03 07:45:10 +01:00

26 lines
613 B
C++

#include "Video.h"
#include "Image.h"
#include "FfmpegInterface.h"
#include "PngWriter.h"
#include "PngWriterImpl.h"
#include <iostream>
int main()
{
auto video = Video::Create();
video->SetPath("/home/jmsgrogan/test.mp4");
FfmpegInterface decoder;
auto images = decoder.decodeToImages(video, 4);
std::cout << "Got " << std::to_string(images.size()) << std::endl;
PngWriter writer;
for(unsigned idx=0; idx<20; idx++)
{
auto filename = "test_out" + std::to_string(idx) + ".png";
writer.SetPath(filename);
writer.Write(images[idx]);
}
return 0;
}