-
Store the extracted frame name in array when executed from within a C program
I’m using the following C code to execute ffmpeg from within a C program
#include <stdio.h>
#include <stdlib.h>int main()
{char *app = "D:\\ffmpeg\\bin\\ffmpeg.exe -i";
char *input = " D:\\video.mpg";
char *output = " D:\\frames\\image%d.jpg";
char *param = " -r 10";
char str[300];
snprintf(str, sizeof str, "%s%s%s%s", app, input, param, output);
// str contains "D:\ffmpeg\bin\ffmpeg.exe -i D:\video.mpg -r 10 D:\frames"\image%d.jpg
system(str); // <-- working fine, frames are being extracted
/*
do something here to store each extracted frame in an array
so that the array contains image1.jpg, image2.jpg, image3.jpg...and so on
*/
getch();
return 0;
}Is there a way to store the filenames in an array as and when they are extracted?