Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Store the extracted frame name in array when executed from within a C program

  • Store the extracted frame name in array when executed from within a C program

    Posted by Narain Kumar on February 19, 2013 at 10:53 am

    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?

    Reuben Martin replied 13 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Reuben Martin

    February 19, 2013 at 9:04 pm

    You will have a lot more control integrating the libraries from the project rather than trying to call ffmpeg directly.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy