FFmpeg
Data Structures | Macros | Functions | Variables
vf_ocr.c File Reference
#include <tesseract/capi.h>
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  OCRContext
 

Macros

#define OFFSET(x)   offsetof(OCRContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static av_cold void uninit (AVFilterContext *ctx)
 
 AVFILTER_DEFINE_CLASS (ocr)
 

Variables

static const AVOption ocr_options []
 
static const AVFilterPad ocr_inputs []
 
static const AVFilterPad ocr_outputs []
 
AVFilter ff_vf_ocr
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(OCRContext, x)

Definition at line 40 of file vf_ocr.c.

◆ FLAGS

Definition at line 41 of file vf_ocr.c.

Function Documentation

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 51 of file vf_ocr.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 76 of file vf_ocr.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 96 of file vf_ocr.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 122 of file vf_ocr.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( ocr  )

Variable Documentation

◆ ocr_options

const AVOption ocr_options[]
static
Initial value:
= {
{ "datapath", "set datapath", OFFSET(datapath), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
{ "language", "set language", OFFSET(language), AV_OPT_TYPE_STRING, {.str="eng"}, 0, 0, FLAGS },
{ "whitelist", "set character whitelist", OFFSET(whitelist), AV_OPT_TYPE_STRING, {.str="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.:;,-+_!?\"'[]{}()<>|/\\=*&%$#@!~"}, 0, 0, FLAGS },
{ "blacklist", "set character blacklist", OFFSET(blacklist), AV_OPT_TYPE_STRING, {.str=""}, 0, 0, FLAGS },
{ NULL }
}

Definition at line 43 of file vf_ocr.c.

◆ ocr_inputs

const AVFilterPad ocr_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
},
{ NULL }
}

Definition at line 132 of file vf_ocr.c.

◆ ocr_outputs

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

Definition at line 141 of file vf_ocr.c.

◆ ff_vf_ocr

AVFilter ff_vf_ocr
Initial value:
= {
.name = "ocr",
.description = NULL_IF_CONFIG_SMALL("Optical Character Recognition."),
.priv_size = sizeof(OCRContext),
.priv_class = &ocr_class,
.init = init,
}

Definition at line 149 of file vf_ocr.c.

init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_ocr.c:51
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_ocr.c:122
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_ocr.c:76
FLAGS
#define FLAGS
Definition: vf_ocr.c:41
ocr_outputs
static const AVFilterPad ocr_outputs[]
Definition: vf_ocr.c:141
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
ocr_inputs
static const AVFilterPad ocr_inputs[]
Definition: vf_ocr.c:132
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: vf_ocr.c:96
OCRContext
Definition: vf_ocr.c:29
language
Undefined Behavior In the C language
Definition: undefined.txt:3
OFFSET
#define OFFSET(x)
Definition: vf_ocr.c:40
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:227