FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
vf_thumbnail.c File Reference

Potential thumbnail lookup filter to reduce the risk of an inappropriate selection (such as a black frame) we could get with an absolute seek. More...

#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  thumb_frame
 
struct  ThumbContext
 

Macros

#define HIST_SIZE   (3*256)
 

Functions

static av_cold int init (AVFilterContext *ctx, const char *args)
 
static double frame_sum_square_err (const int *hist, const double *median)
 Compute Sum-square deviation to estimate "closeness".
 
static int filter_frame (AVFilterLink *inlink, AVFilterBufferRef *frame)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int request_frame (AVFilterLink *link)
 
static int poll_frame (AVFilterLink *link)
 
static int query_formats (AVFilterContext *ctx)
 

Variables

static const AVFilterPad thumbnail_inputs []
 
static const AVFilterPad thumbnail_outputs []
 
AVFilter avfilter_vf_thumbnail
 

Detailed Description

Potential thumbnail lookup filter to reduce the risk of an inappropriate selection (such as a black frame) we could get with an absolute seek.

Simplified version of algorithm by Vadim Zaliva lord@.nosp@m.croc.nosp@m.odile.nosp@m..org.

See Also
http://notbrainsurgery.livejournal.com/29773.html

Definition in file vf_thumbnail.c.

Macro Definition Documentation

#define HIST_SIZE   (3*256)

Definition at line 33 of file vf_thumbnail.c.

Referenced by filter_frame(), and frame_sum_square_err().

Function Documentation

static av_cold int init ( AVFilterContext ctx,
const char *  args 
)
static

Definition at line 46 of file vf_thumbnail.c.

static double frame_sum_square_err ( const int *  hist,
const double *  median 
)
static

Compute Sum-square deviation to estimate "closeness".

Parameters
histcolor distribution histogram
medianaverage color distribution histogram
Returns
sum of squared errors

Definition at line 77 of file vf_thumbnail.c.

Referenced by filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFilterBufferRef frame 
)
static

Definition at line 89 of file vf_thumbnail.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 150 of file vf_thumbnail.c.

static int request_frame ( AVFilterLink link)
static

Definition at line 159 of file vf_thumbnail.c.

static int poll_frame ( AVFilterLink link)
static

Definition at line 173 of file vf_thumbnail.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 195 of file vf_thumbnail.c.

Variable Documentation

const AVFilterPad thumbnail_inputs[]
static
Initial value:
= {
{
.name = "default",
.get_video_buffer = ff_null_get_video_buffer,
.min_perms = AV_PERM_PRESERVE,
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 205 of file vf_thumbnail.c.

const AVFilterPad thumbnail_outputs[]
static
Initial value:
= {
{
.name = "default",
.request_frame = request_frame,
.poll_frame = poll_frame,
},
{ NULL }
}

Definition at line 216 of file vf_thumbnail.c.

AVFilter avfilter_vf_thumbnail
Initial value:
= {
.name = "thumbnail",
.description = NULL_IF_CONFIG_SMALL("Select the most representative frame in a given sequence of consecutive frames."),
.priv_size = sizeof(ThumbContext),
.init = init,
}

Definition at line 226 of file vf_thumbnail.c.