FFmpeg
Loading...
Searching...
No Matches
f_select.c File Reference

filter for selecting which frame passes in the filterchain More...

#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/eval.h"
#include "libavutil/fifo.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"
#include "formats.h"
#include "video.h"
#include "scene_sad.h"

Go to the source code of this file.

Data Structures

struct  SelectContext
 

Macros

#define OFFSET(x)
 
#define DEFINE_OPTIONS(filt_name, FLAGS)
 
#define INTERLACE_TYPE_P   0
 
#define INTERLACE_TYPE_T   1
 
#define INTERLACE_TYPE_B   2
 

Enumerations

enum  var_name {
  VAR_TB , VAR_PTS , VAR_START_PTS , VAR_PREV_PTS ,
  VAR_PREV_SELECTED_PTS , VAR_T , VAR_START_T , VAR_PREV_T ,
  VAR_PREV_SELECTED_T , VAR_PICT_TYPE , VAR_I , VAR_P ,
  VAR_B , VAR_S , VAR_SI , VAR_SP ,
  VAR_BI , VAR_PICT_TYPE_I , VAR_PICT_TYPE_P , VAR_PICT_TYPE_B ,
  VAR_PICT_TYPE_S , VAR_PICT_TYPE_SI , VAR_PICT_TYPE_SP , VAR_PICT_TYPE_BI ,
  VAR_INTERLACE_TYPE , VAR_INTERLACE_TYPE_P , VAR_INTERLACE_TYPE_T , VAR_INTERLACE_TYPE_B ,
  VAR_CONSUMED_SAMPLES_N , VAR_SAMPLES_N , VAR_SAMPLE_RATE , VAR_N ,
  VAR_SELECTED_N , VAR_PREV_SELECTED_N , VAR_KEY , VAR_SCENE ,
  VAR_CONCATDEC_SELECT , VAR_IH , VAR_IW , VAR_VIEW ,
  VAR_VARS_NB
}
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static double get_scene_score (AVFilterContext *ctx, AVFrame *frame)
 
static double get_concatdec_select (AVFrame *frame, int64_t pts)
 
static void select_frame (AVFilterContext *ctx, AVFrame *frame)
 
static int activate (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const char *const var_names []
 

Detailed Description

filter for selecting which frame passes in the filterchain

Definition in file f_select.c.

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 172 of file f_select.c.

◆ DEFINE_OPTIONS

#define DEFINE_OPTIONS ( filt_name,
FLAGS )
Value:
static const AVOption filt_name##_options[] = { \
{ "expr", "set an expression to use for selecting frames", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "1" }, .flags=FLAGS }, \
{ "e", "set an expression to use for selecting frames", OFFSET(expr_str), AV_OPT_TYPE_STRING, { .str = "1" }, .flags=FLAGS }, \
{ "outputs", "set the number of outputs", OFFSET(nb_outputs), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, .flags=FLAGS }, \
{ "n", "set the number of outputs", OFFSET(nb_outputs), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, .flags=FLAGS }, \
{ NULL } \
}
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
AVOption.
Definition opt.h:428

Definition at line 173 of file f_select.c.

◆ INTERLACE_TYPE_P

#define INTERLACE_TYPE_P   0

Definition at line 209 of file f_select.c.

Referenced by config_input(), and select_frame().

◆ INTERLACE_TYPE_T

#define INTERLACE_TYPE_T   1

Definition at line 210 of file f_select.c.

Referenced by config_input(), and select_frame().

◆ INTERLACE_TYPE_B

#define INTERLACE_TYPE_B   2

Definition at line 211 of file f_select.c.

Referenced by config_input(), and select_frame().

Enumeration Type Documentation

◆ var_name

enum var_name
Enumerator
VAR_TB 
VAR_PTS 
VAR_START_PTS 
VAR_PREV_PTS 
VAR_PREV_SELECTED_PTS 
VAR_T 
VAR_START_T 
VAR_PREV_T 
VAR_PREV_SELECTED_T 
VAR_PICT_TYPE 
VAR_I 
VAR_P 
VAR_B 
VAR_S 
VAR_SI 
VAR_SP 
VAR_BI 
VAR_PICT_TYPE_I 
VAR_PICT_TYPE_P 
VAR_PICT_TYPE_B 
VAR_PICT_TYPE_S 
VAR_PICT_TYPE_SI 
VAR_PICT_TYPE_SP 
VAR_PICT_TYPE_BI 
VAR_INTERLACE_TYPE 
VAR_INTERLACE_TYPE_P 
VAR_INTERLACE_TYPE_T 
VAR_INTERLACE_TYPE_B 
VAR_CONSUMED_SAMPLES_N 
VAR_SAMPLES_N 
VAR_SAMPLE_RATE 
VAR_N 
VAR_SELECTED_N 
VAR_PREV_SELECTED_N 
VAR_KEY 
VAR_SCENE 
VAR_CONCATDEC_SELECT 
VAR_IH 
VAR_IW 
VAR_VIEW 
VAR_VARS_NB 

Definition at line 98 of file f_select.c.

Function Documentation

◆ init()

static av_cold int init ( AVFilterContext * ctx)
static

Definition at line 182 of file f_select.c.

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 213 of file f_select.c.

◆ get_scene_score()

static double get_scene_score ( AVFilterContext * ctx,
AVFrame * frame )
static

Definition at line 282 of file f_select.c.

Referenced by select_frame().

◆ get_concatdec_select()

static double get_concatdec_select ( AVFrame * frame,
int64_t pts )
static

Definition at line 314 of file f_select.c.

Referenced by select_frame().

◆ select_frame()

static void select_frame ( AVFilterContext * ctx,
AVFrame * frame )
static

Definition at line 336 of file f_select.c.

Referenced by activate().

◆ activate()

static int activate ( AVFilterContext * ctx)
static

Definition at line 428 of file f_select.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 459 of file f_select.c.

Variable Documentation

◆ var_names

const char* const var_names[]
static

Definition at line 42 of file f_select.c.