summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-audio.com>2015-10-20 15:34:36 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-21 22:11:33 +0200
commit18e8fac531cb4b7db3d6d36b222c99e3e8968cfe (patch)
treec126709a019119bf660232a76cfc15c507a1bd72
parent98da061461f5490bd6346869b84a49dc451f57c7 (diff)
downloadffmpeg-streaming-18e8fac531cb4b7db3d6d36b222c99e3e8968cfe.zip
ffmpeg-streaming-18e8fac531cb4b7db3d6d36b222c99e3e8968cfe.tar.gz
avfilter/vf_ssim: Add support for writing stats to stdout
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--doc/filters.texi3
-rw-r--r--libavfilter/vf_ssim.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 486398d..6a1596e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10226,7 +10226,8 @@ The description of the accepted parameters follows.
@table @option
@item stats_file, f
If specified the filter will use the named file to save the SSIM of
-each individual frame.
+each individual frame. When filename equals "-" the data is sent to
+standard output.
@end table
The file printed if @var{stats_file} is selected, contains a sequence of
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 5cd9361..b23d447 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -223,7 +223,9 @@ static av_cold int init(AVFilterContext *ctx)
{
SSIMContext *s = ctx->priv;
- if (s->stats_file_str) {
+ if (!strcmp(s->stats_file_str, "-")) {
+ s->stats_file = stdout;
+ } else if (s->stats_file_str) {
s->stats_file = fopen(s->stats_file_str, "w");
if (!s->stats_file) {
int err = AVERROR(errno);
@@ -354,7 +356,7 @@ static av_cold void uninit(AVFilterContext *ctx)
ff_dualinput_uninit(&s->dinput);
- if (s->stats_file)
+ if (s->stats_file && s->stats_file != stdout)
fclose(s->stats_file);
av_freep(&s->temp);
OpenPOWER on IntegriCloud