aboutsummaryrefslogtreecommitdiff
path: root/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'args.c')
-rw-r--r--args.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/args.c b/args.c
index e2248a6..54fa956 100644
--- a/args.c
+++ b/args.c
@@ -35,7 +35,7 @@ void print_usage(char *name)
printf("Usage:\n");
printf("\t%s\n", name);
printf("\t-c <codec> - The codec to be used for encoding\n");
- printf("\t\t Available codecs: mpeg4, h264, h263, xvid, mpeg2, mpeg1, vp8\n");
+ printf("\t\t Available codecs: mpeg4, h264, h265, h263, xvid, mpeg2, mpeg1, vp8, vp9\n");
printf("\t-d use dmabuf instead of mmap\n");
printf("\t-m <device> - video encoder device (e.g. /dev/video33)\n");
printf("\t-w video width\n");
@@ -45,6 +45,7 @@ void print_usage(char *name)
printf("\t-v verbose mode\n");
printf("\t-B bitrate\n");
printf("\t-F framerate\n");
+ printf("\t-b number of B frames\n");
printf("\n");
}
@@ -69,6 +70,10 @@ int get_codec(char *str)
return V4L2_PIX_FMT_MPEG1;
} else if (strncasecmp("vp8", str, 5) == 0) {
return V4L2_PIX_FMT_VP8;
+ } else if (strncasecmp("vp9", str, 5) == 0) {
+ return V4L2_PIX_FMT_VP9;
+ } else if (strncasecmp("h265", str, 5) == 0) {
+ return V4L2_PIX_FMT_HEVC;
}
return 0;
}
@@ -79,7 +84,7 @@ int parse_args(struct instance *i, int argc, char **argv)
init_to_defaults(i);
- while ((c = getopt(argc, argv, "w:h:c:d:m:f:n:gvB:F:")) != -1) {
+ while ((c = getopt(argc, argv, "w:h:c:d:m:f:n:gvB:F:b:")) != -1) {
switch (c) {
case 'c':
i->codec = get_codec(optarg);
@@ -116,6 +121,12 @@ int parse_args(struct instance *i, int argc, char **argv)
case 'F':
i->framerate = atoi(optarg);
break;
+ case 'b':
+ i->num_bframes = atoi(optarg);
+ break;
+ case 'p':
+ i->num_pframes = atoi(optarg);
+ break;
default:
err("Bad argument");
return -1;