From: Nikita Danilov Date: Wed, 19 Dec 2012 18:27:21 +0000 (-0700) Subject: iowatcher: iowatcher: specify ffmpeg codec X-Git-Tag: blktrace-1.1.0~2^2~30 X-Git-Url: https://git.kernel.dk/?p=blktrace.git;a=commitdiff_plain;h=a51ad4aeabcf7e868fe92fa06c82137d6b763104 iowatcher: iowatcher: specify ffmpeg codec Add -C option to specify ffmped video code to use. Allow ffmpeg video codec to be specified on the command line. "libx264" is default. Signed-off-by: Chris Mason --- diff --git a/iowatcher/main.c b/iowatcher/main.c index 6e392f2..41b2828 100644 --- a/iowatcher/main.c +++ b/iowatcher/main.c @@ -143,6 +143,7 @@ static char *blktrace_device = NULL; static char *blktrace_outfile = "trace"; static char *blktrace_dest_dir = "."; static char *program_to_run = NULL; +static char *ffmpeg_codec = "libx264"; static void alloc_mpstat_gld(struct trace_file *tf) { @@ -873,7 +874,8 @@ static void mencode_movie(char *movie_dir) { fprintf(stderr, "Creating movie %s with ffmpeg\n", movie_dir); snprintf(line, line_len, "ffmpeg -r 20 -y -i %s/%%10d-%s.svg.png -b:v 250k " - "-vcodec libx264 %s", movie_dir, output_filename, output_filename); + "-vcodec %s %s", movie_dir, output_filename, ffmpeg_codec, + output_filename); system(line); } @@ -1148,7 +1150,7 @@ enum { HELP_LONG_OPT = 1, }; -char *option_string = "T:t:o:l:r:O:N:d:D:p:m::h:w:c:x:y:a:PK"; +char *option_string = "T:t:o:l:r:O:N:d:D:p:m::h:w:c:x:y:a:C:PK"; static struct option long_options[] = { {"columns", required_argument, 0, 'c'}, {"title", required_argument, 0, 'T'}, @@ -1162,6 +1164,7 @@ static struct option long_options[] = { {"blktrace-destination", required_argument, 0, 'D'}, {"prog", required_argument, 0, 'p'}, {"movie", optional_argument, 0, 'm'}, + {"codec", optional_argument, 0, 'C'}, {"keep-movie-svgs", no_argument, 0, 'K'}, {"width", required_argument, 0, 'w'}, {"height", required_argument, 0, 'h'}, @@ -1184,6 +1187,7 @@ static void print_usage(void) "\t-p (--prog): program to run while blktrace is run\n" "\t-K (--keep-movie-svgs keep svgs generated for movie mode\n" "\t-m (--movie [=spindle|rect]): create IO animations\n" + "\t-C (--codec): ffmpeg codec. Use ffmpeg -codecs to list\n" "\t-r (--rolling): number of seconds in the rolling averge\n" "\t-T (--title): graph title\n" "\t-N (--no-graph): skip a single graph (io, tput, latency, queue_depth, \n" @@ -1323,6 +1327,9 @@ static int parse_options(int ac, char **av) fprintf(stderr, "Using movie style: %s\n", movie_styles[movie_style]); break; + case 'C': + ffmpeg_codec = strdup(optarg); + break; case 'h': opt_graph_height = atoi(optarg); break;