vf_subtitles.c File Reference

Libass subtitles burning filter. More...

#include <ass/ass.h>
#include "config.h"
#include "libavutil/avstring.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "drawutils.h"
#include "avfilter.h"
#include "internal.h"
#include "formats.h"
#include "video.h"
Include dependency graph for vf_subtitles.c:

Go to the source code of this file.

Data Structures

struct  AssContext
 

Macros

#define OFFSET(x)   offsetof(AssContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 
#define COMMON_OPTIONS
 
#define AR(c)   ( (c)>>24)
 
#define AG(c)   (((c)>>16)&0xFF)
 
#define AB(c)   (((c)>>8) &0xFF)
 
#define AA(c)   ((0xFF-c) &0xFF)
 

Functions

static void ass_log (int ass_level, const char *fmt, va_list args, void *ctx)
 
static av_cold int init (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static void overlay_ass_image (AssContext *ass, AVFrame *picref, const ASS_Image *image)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *picref)
 

Variables

static const int ass_libavfilter_log_level_map []
 
static const AVFilterPad ass_inputs []
 
static const AVFilterPad ass_outputs []
 

Detailed Description

Libass subtitles burning filter.

See also
{http://www.matroska.org/technical/specs/subtitles/ssa.html}

Definition in file vf_subtitles.c.

Macro Definition Documentation

#define AA (   c)    ((0xFF-c) &0xFF)

Definition at line 150 of file vf_subtitles.c.

Referenced by overlay_ass_image().

#define AB (   c)    (((c)>>8) &0xFF)

Definition at line 149 of file vf_subtitles.c.

Referenced by overlay_ass_image().

#define AG (   c)    (((c)>>16)&0xFF)

Definition at line 148 of file vf_subtitles.c.

Referenced by overlay_ass_image().

#define AR (   c)    ( (c)>>24)

Definition at line 147 of file vf_subtitles.c.

Referenced by overlay_ass_image().

#define COMMON_OPTIONS
Value:
{"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
{"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
{"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, \
NULL
Definition: eval.c:55
offset must point to two consecutive integers
Definition: opt.h:230
#define OFFSET(x)
Definition: vf_subtitles.c:60
#define FLAGS
Definition: vf_subtitles.c:61

Definition at line 63 of file vf_subtitles.c.

Definition at line 61 of file vf_subtitles.c.

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

Definition at line 60 of file vf_subtitles.c.

Function Documentation

static void ass_log ( int  ass_level,
const char *  fmt,
va_list  args,
void ctx 
)
static

Definition at line 80 of file vf_subtitles.c.

Referenced by init().

static int config_input ( AVFilterLink inlink)
static

Definition at line 132 of file vf_subtitles.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame picref 
)
static

Definition at line 167 of file vf_subtitles.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 88 of file vf_subtitles.c.

static void overlay_ass_image ( AssContext ass,
AVFrame picref,
const ASS_Image *  image 
)
static

Definition at line 152 of file vf_subtitles.c.

Referenced by filter_frame().

static int query_formats ( AVFilterContext ctx)
static

Definition at line 126 of file vf_subtitles.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 114 of file vf_subtitles.c.

Variable Documentation

const AVFilterPad ass_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
.needs_writable = 1,
},
{ NULL }
}
static int config_input(AVFilterLink *inlink)
Definition: vf_subtitles.c:132
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
Definition: vf_subtitles.c:167
NULL
Definition: eval.c:55

Definition at line 185 of file vf_subtitles.c.

const int ass_libavfilter_log_level_map[]
static
Initial value:
= {
}
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
Definition: log.h:135
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:154
#define AV_LOG_QUIET
Definition: log.h:130
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition: log.h:142
#define AV_LOG_VERBOSE
Definition: log.h:157
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:162
#define AV_LOG_INFO
Definition: log.h:156

Definition at line 69 of file vf_subtitles.c.

Referenced by ass_log().

const AVFilterPad ass_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 196 of file vf_subtitles.c.