stuff-from-scratch/test/video/TestVideoDecoder.cpp

24 lines
548 B
C++
Raw Normal View History

2022-01-01 18:46:31 +00:00
#include "Video.h"
#include "Image.h"
#include "FfmpegInterface.h"
#include "PngWriter.h"
2022-11-29 18:00:19 +00:00
#include "TestFramework.h"
TEST_CASE(TestVideoDecoder, "video")
2022-01-01 18:46:31 +00:00
{
auto video = Video::Create();
2022-12-01 10:52:48 +00:00
video->SetPath(TestUtils::getTestDataDir() / "test.mp4");
2022-01-01 18:46:31 +00:00
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";
2022-12-01 10:52:48 +00:00
writer.setPath(filename);
writer.write(images[idx]);
2022-01-01 18:46:31 +00:00
}
}