Ignore:
Timestamp:
Oct 16, 2010, 11:53:01 PM (11 years ago)
Author:
Sam Hocevar
Message:

Make the movie generation methods and program more versatile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/examples/makemovie.c

    r3627 r4694  
    2323#define WIDTH 1280
    2424#define HEIGHT 720
    25 #define FPS 30
    2625
    2726int main(int argc, char *argv[])
     
    3130    pipi_sequence_t *seq;
    3231    pipi_pixels_t *p;
     32    int width, height, fps, par_num, par_den, bitrate;
    3333    int f;
    3434
     35    width = 1280;
     36    height = 720;
     37    fps = 30;
     38    par_num = 1;
     39    par_den = 1;
     40    bitrate = 16 * 1024 * 1024;
     41
    3542    if(argc < 2)
     43    {
     44        fprintf(stderr, "usage: makemovie FILE [width [height [fps [par_num [par_den [bitrate]]]]]]>\n");
    3645        return EXIT_FAILURE;
     46    }
    3747
    38     seq = pipi_open_sequence(argv[1], WIDTH, HEIGHT, FPS);
     48    if (argc > 2)
     49        width = atoi(argv[2]);
     50    if (argc > 3)
     51        height = atoi(argv[3]);
     52    if (argc > 4)
     53        fps = atoi(argv[4]);
     54    if (argc > 5)
     55        par_num = atoi(argv[5]);
     56    if (argc > 6)
     57        par_den = atoi(argv[6]);
     58    if (argc > 7)
     59        bitrate = atoi(argv[7]);
     60
     61    seq = pipi_open_sequence(argv[1], width, height, fps,
     62                             par_num, par_den, bitrate);
    3963    if(!seq)
    4064        return EXIT_FAILURE;
Note: See TracChangeset for help on using the changeset viewer.