libavfilter/vf_blackdetect.c File Reference

Video black detector, loosely based on blackframe with extended syntax and features. More...

#include <float.h>
#include "libavutil/opt.h"
#include "libavutil/timestamp.h"
#include "avfilter.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  BlackDetectContext

Defines

#define OFFSET(x)   offsetof(BlackDetectContext, x)
#define YUVJ_FORMATS   PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P

Functions

static const char * blackdetect_get_name (void *ctx)
static int query_formats (AVFilterContext *ctx)
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
static int config_input (AVFilterLink *inlink)
static void draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static void end_frame (AVFilterLink *inlink)

Variables

static const AVOption blackdetect_options []
static const AVClass blackdetect_class
static enum PixelFormat yuvj_formats []
AVFilter avfilter_vf_blackdetect


Detailed Description

Video black detector, loosely based on blackframe with extended syntax and features.

Definition in file vf_blackdetect.c.


Define Documentation

#define OFFSET (  )     offsetof(BlackDetectContext, x)

Definition at line 49 of file vf_blackdetect.c.

#define YUVJ_FORMATS   PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P

Definition at line 71 of file vf_blackdetect.c.

Referenced by query_formats().


Function Documentation

static const char* blackdetect_get_name ( void *  ctx  )  [static]

Definition at line 60 of file vf_blackdetect.c.

static int config_input ( AVFilterLink inlink  )  [static]

Definition at line 107 of file vf_blackdetect.c.

static void draw_slice ( AVFilterLink inlink,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 128 of file vf_blackdetect.c.

static void end_frame ( AVFilterLink inlink  )  [static]

Definition at line 145 of file vf_blackdetect.c.

static av_cold int init ( AVFilterContext ctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 91 of file vf_blackdetect.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 78 of file vf_blackdetect.c.


Variable Documentation

Initial value:

 {
    .name          = "blackdetect",
    .description   = NULL_IF_CONFIG_SMALL("Detect video intervals that are (almost) black."),
    .priv_size     = sizeof(BlackDetectContext),
    .init          = init,
    .query_formats = query_formats,

    .inputs = (const AVFilterPad[]) {
        { .name             = "default",
          .type             = AVMEDIA_TYPE_VIDEO,
          .config_props     = config_input,
          .draw_slice       = draw_slice,
          .get_video_buffer = avfilter_null_get_video_buffer,
          .start_frame      = ff_null_start_frame_keep_ref,
          .end_frame        = end_frame, },
        { .name = NULL }
    },

    .outputs = (const AVFilterPad[]) {
        { .name             = "default",
          .type             = AVMEDIA_TYPE_VIDEO },
        { .name = NULL }
    },
}

Definition at line 187 of file vf_blackdetect.c.

const AVClass blackdetect_class [static]

Initial value:

 {
    .class_name = "BlackDetectContext",
    .item_name  = blackdetect_get_name,
    .option     = blackdetect_options,
}

Definition at line 65 of file vf_blackdetect.c.

const AVOption blackdetect_options[] [static]

Initial value:

 {
    { "d",                  "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX},
    { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX},
    { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1},
    { "pic_th",                 "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1},
    { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1},
    { "pix_th",         "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1},
    { NULL },
}

Definition at line 50 of file vf_blackdetect.c.

enum PixelFormat yuvj_formats[] [static]

Initial value:

Definition at line 74 of file vf_blackdetect.c.

Referenced by config_input().


Generated on Fri Oct 26 02:48:01 2012 for FFmpeg by  doxygen 1.5.8