FFmpeg
Data Structures | Macros | Functions | Variables
vf_subtitles.c File Reference
#include <ass/ass.h>
#include "config.h"
#include "config_components.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"

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

◆ OFFSET

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

Definition at line 66 of file vf_subtitles.c.

◆ FLAGS

Definition at line 67 of file vf_subtitles.c.

◆ COMMON_OPTIONS

#define COMMON_OPTIONS
Value:
{"filename", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \
{"f", "set the filename of file to read", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \
{"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, \
{"fontsdir", "set the directory containing the fonts to read", OFFSET(fontsdir), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, \
{"alpha", "enable processing of alpha channel", OFFSET(alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, FLAGS }, \

Definition at line 69 of file vf_subtitles.c.

◆ AR

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

Definition at line 164 of file vf_subtitles.c.

◆ AG

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

Definition at line 165 of file vf_subtitles.c.

◆ AB

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

Definition at line 166 of file vf_subtitles.c.

◆ AA

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

Definition at line 167 of file vf_subtitles.c.

Function Documentation

◆ ass_log()

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

Definition at line 88 of file vf_subtitles.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 98 of file vf_subtitles.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 126 of file vf_subtitles.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 138 of file vf_subtitles.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 143 of file vf_subtitles.c.

◆ overlay_ass_image()

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

Definition at line 169 of file vf_subtitles.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame picref 
)
static

Definition at line 184 of file vf_subtitles.c.

Variable Documentation

◆ ass_libavfilter_log_level_map

const int ass_libavfilter_log_level_map[]
static
Initial value:
= {
[0] = AV_LOG_FATAL,
[1] = AV_LOG_ERROR,
[4] = AV_LOG_INFO,
[5] = AV_LOG_INFO,
[7] = AV_LOG_DEBUG,
}

Definition at line 77 of file vf_subtitles.c.

Referenced by ass_log().

◆ ass_inputs

const AVFilterPad ass_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}

Definition at line 202 of file vf_subtitles.c.

◆ ass_outputs

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

Definition at line 212 of file vf_subtitles.c.

AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
config_input
static int config_input(AVFilterLink *inlink)
Definition: vf_subtitles.c:143
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:191
AV_LOG_FATAL
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition: log.h:174
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
alpha
static const int16_t alpha[]
Definition: ilbcdata.h:55
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
Definition: vf_subtitles.c:184
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
FLAGS
#define FLAGS
Definition: vf_subtitles.c:67
OFFSET
#define OFFSET(x)
Definition: vf_subtitles.c:66
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:68