mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-31 23:59:34 +00:00
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>
This commit is contained in:
parent
98da061461
commit
18e8fac531
@ -10226,7 +10226,8 @@ The description of the accepted parameters follows.
|
|||||||
@table @option
|
@table @option
|
||||||
@item stats_file, f
|
@item stats_file, f
|
||||||
If specified the filter will use the named file to save the SSIM of
|
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
|
@end table
|
||||||
|
|
||||||
The file printed if @var{stats_file} is selected, contains a sequence of
|
The file printed if @var{stats_file} is selected, contains a sequence of
|
||||||
|
@ -223,7 +223,9 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
{
|
{
|
||||||
SSIMContext *s = ctx->priv;
|
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");
|
s->stats_file = fopen(s->stats_file_str, "w");
|
||||||
if (!s->stats_file) {
|
if (!s->stats_file) {
|
||||||
int err = AVERROR(errno);
|
int err = AVERROR(errno);
|
||||||
@ -354,7 +356,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
|||||||
|
|
||||||
ff_dualinput_uninit(&s->dinput);
|
ff_dualinput_uninit(&s->dinput);
|
||||||
|
|
||||||
if (s->stats_file)
|
if (s->stats_file && s->stats_file != stdout)
|
||||||
fclose(s->stats_file);
|
fclose(s->stats_file);
|
||||||
|
|
||||||
av_freep(&s->temp);
|
av_freep(&s->temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user