summaryrefslogtreecommitdiff
path: root/tools/aviocat.c
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2019-07-19 14:21:13 +0200
committerNicolas George <george@nsup.org>2019-08-13 15:38:57 +0200
commit2b4c1a0f3cdbdfd4f02509a513d4e4bdd12e955d (patch)
tree1bb08e5943873b6eb7f194e48c389e3924eaa3cb /tools/aviocat.c
parent8cd96e13eea858108667000d47281b8811042d1b (diff)
downloadffmpeg-2b4c1a0f3cdbdfd4f02509a513d4e4bdd12e955d.tar.gz
tools/aviocat: add verbose mode.
For now: print the input size as detected by AVSEEK_SIZE.
Diffstat (limited to 'tools/aviocat.c')
-rw-r--r--tools/aviocat.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/aviocat.c b/tools/aviocat.c
index 2aa08b92ed..816ab700ef 100644
--- a/tools/aviocat.c
+++ b/tools/aviocat.c
@@ -26,14 +26,14 @@
static int usage(const char *argv0, int ret)
{
- fprintf(stderr, "%s [-b bytespersec] [-d duration] [-oi <options>] [-oo <options>] input_url output_url\n", argv0);
+ fprintf(stderr, "%s [-b bytespersec] [-d duration] [-oi <options>] [-oo <options>] [-v] input_url output_url\n", argv0);
fprintf(stderr, "<options>: AVOptions expressed as key=value, :-separated\n");
return ret;
}
int main(int argc, char **argv)
{
- int bps = 0, duration = 0, ret, i;
+ int bps = 0, duration = 0, verbose = 0, ret, i;
const char *input_url = NULL, *output_url = NULL;
int64_t stream_pos = 0;
int64_t start_time;
@@ -65,6 +65,8 @@ int main(int argc, char **argv)
return usage(argv[0], 1);
}
i++;
+ } else if (!strcmp(argv[i], "-v")) {
+ verbose = 1;
} else if (!input_url) {
input_url = argv[i];
} else if (!output_url) {
@@ -82,6 +84,14 @@ int main(int argc, char **argv)
fprintf(stderr, "Unable to open %s: %s\n", input_url, errbuf);
return 1;
}
+ if (verbose) {
+ int64_t size = avio_seek(input, 0, AVSEEK_SIZE);
+ if (size >= 0) {
+ fprintf(stderr, "aviocat: input size: %"PRId64"\n", size);
+ } else {
+ fprintf(stderr, "aviocat: input size: unknown\n");
+ }
+ }
if (duration && !bps) {
int64_t size = avio_size(input);
if (size < 0) {