stuff-from-scratch/test/video/TestVideoDecoder.cpp
2022-12-01 10:52:48 +00:00

23 lines
548 B
C++

#include "Video.h"
#include "Image.h"
#include "FfmpegInterface.h"
#include "PngWriter.h"
#include "TestFramework.h"
TEST_CASE(TestVideoDecoder, "video")
{
auto video = Video::Create();
video->SetPath(TestUtils::getTestDataDir() / "test.mp4");
FfmpegInterface decoder;
auto images = decoder.decodeToImages(video, 4);
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]);
}
}