diff options
author | Mans Rullgard <mans@mansr.com> | 2012-05-17 15:55:14 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-05-29 08:27:19 +0100 |
commit | 7e5880e0cb041d0f1362bddd75130471ffc811ce (patch) | |
tree | d6f21c578766d7e26636a62a8f833dd407275376 /tests/videogen.c | |
parent | e999b641df85c4e7fa89dde1c681ddd1d38b0090 (diff) | |
download | ffmpeg-7e5880e0cb041d0f1362bddd75130471ffc811ce.tar.gz |
fate: teach videogen/rotozoom to output a single raw video stream
This makes videogen/rotozoom output a raw video stream on stdout
if no output directory is specified.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'tests/videogen.c')
-rw-r--r-- | tests/videogen.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/videogen.c b/tests/videogen.c index 8c3d53976e..7228bd551c 100644 --- a/tests/videogen.c +++ b/tests/videogen.c @@ -146,12 +146,15 @@ int main(int argc, char **argv) int w, h, i; char buf[1024]; - if (argc != 2) { - printf("usage: %s file\n" + if (argc > 2) { + printf("usage: %s [file]\n" "generate a test video stream\n", argv[0]); exit(1); } + if (argc < 2) + err_if(!freopen(NULL, "wb", stdout)); + w = DEFAULT_WIDTH; h = DEFAULT_HEIGHT; @@ -161,9 +164,13 @@ int main(int argc, char **argv) height = h; for (i = 0; i < DEFAULT_NB_PICT; i++) { - snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[1], i); gen_image(i, w, h); - pgmyuv_save(buf, w, h, rgb_tab); + if (argc > 1) { + snprintf(buf, sizeof(buf), "%s%02d.pgm", argv[1], i); + pgmyuv_save(buf, w, h, rgb_tab); + } else { + pgmyuv_save(NULL, w, h, rgb_tab); + } } free(rgb_tab); |