2022-01-01 18:46:31 +00:00
|
|
|
#include "Video.h"
|
|
|
|
#include "Image.h"
|
|
|
|
#include "FfmpegInterface.h"
|
|
|
|
#include "PngWriter.h"
|
|
|
|
#include <iostream>
|
|
|
|
|
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();
|
|
|
|
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]);
|
|
|
|
}
|
|
|
|
}
|