summaryrefslogtreecommitdiff
path: root/wcap
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-07-23 11:10:20 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-07-23 11:10:20 -0400
commitf32f096cd81ed472bac48354d916724e2e2329f8 (patch)
treedf42c0792019ae0d24a9f165eed65b6dee74c9f8 /wcap
parentec116022ecb4f26ed1629dfe3ad0341f38f45ac5 (diff)
downloadweston-f32f096cd81ed472bac48354d916724e2e2329f8.tar.gz
wcap: Clarify help message, don't dump yuv4mpeg2 to terminal
Diffstat (limited to 'wcap')
-rw-r--r--wcap/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/wcap/main.c b/wcap/main.c
index 466030ec..3b671b01 100644
--- a/wcap/main.c
+++ b/wcap/main.c
@@ -150,11 +150,11 @@ output_yuv_frame(struct wcap_decoder *decoder)
static void
usage(int exit_code)
{
- fprintf(stderr, "usage: wcap-snapshot "
+ fprintf(stderr, "usage: wcap-decode "
"[--help] [--yuv4mpeg2] [--frame=<frame>] [--all] \n"
"\t[--rate=<num:denom>] <wcap file>\n\n"
"\t--help\t\t\tthis help text\n"
- "\t--yuv2mpeg4\t\tdump wcap file in yuv4mpeg format\n"
+ "\t--yuv2mpeg4\t\tdump wcap file to stdout in yuv4mpeg format\n"
"\t--frame=<frame>\t\twrite out the given frame number as png\n"
"\t--all\t\t\twrite all frames as pngs\n"
"\t--rate=<num:denom>\treplay frame rate for yuv4mpeg2,\n"
@@ -205,6 +205,15 @@ int main(int argc, char *argv[])
decoder = wcap_decoder_create(argv[1]);
+ if (yuv4mpeg2 && isatty(1)) {
+ fprintf(stderr, "Not dumping yuv4mpeg2 data to terminal. Pipe output to a file or a process.\n");
+ fprintf(stderr, "For example, to encode to webm, use something like\n\n");
+ fprintf(stderr, "\t$ wcap-decode --yuv4mpeg2 ../capture.wcap |\n"
+ "\t\tvpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -\n\n");
+
+ exit(EXIT_FAILURE);
+ }
+
if (yuv4mpeg2) {
printf("YUV4MPEG2 C420jpeg W%d H%d F%d:%d Ip A0:0\n",
decoder->width, decoder->height, num, denom);