Go to the documentation of this file.
29 int play_res_x,
int play_res_y,
30 const char *font,
int font_size,
31 int primary_color,
int secondary_color,
32 int outline_color,
int back_color,
33 int bold,
int italic,
int underline,
34 int border_style,
int alignment)
38 "; Script generated by FFmpeg/Lavc%s\r\n"
39 "ScriptType: v4.00+\r\n"
42 "ScaledBorderAndShadow: yes\r\n"
48 "Fontname, Fontsize, "
49 "PrimaryColour, SecondaryColour, OutlineColour, BackColour, "
50 "Bold, Italic, Underline, StrikeOut, "
53 "BorderStyle, Outline, Shadow, "
54 "Alignment, MarginL, MarginR, MarginV, "
60 "&H%x,&H%x,&H%x,&H%x,"
70 "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
72 play_res_x, play_res_y, font, font_size,
73 primary_color, secondary_color, outline_color, back_color,
74 -bold, -italic, -underline, border_style, alignment);
83 const char *font,
int font_size,
84 int color,
int back_color,
85 int bold,
int italic,
int underline,
86 int border_style,
int alignment)
91 back_color, back_color,
92 bold, italic, underline,
93 border_style, alignment);
110 const char *speaker,
const char *text)
113 readorder, layer, style ? style :
"Default",
114 speaker ? speaker :
"", text);
118 int readorder,
int layer,
const char *style,
131 rects[
sub->num_rects++] =
rect;
148 const char *linebreaks,
int keep_ass_markup)
150 const char *p_end = p +
size;
152 for (; p < p_end && *p; p++) {
155 if (linebreaks && strchr(linebreaks, *p)) {
160 }
else if (!keep_ass_markup && strchr(
"{}\\", *p)) {
169 }
else if (p[0] ==
'\n') {
173 }
else if (p[0] ==
'\r' && p < p_end - 1 && p[1] ==
'\n') {
#define LIBAVCODEC_VERSION
int ff_ass_subtitle_header(AVCodecContext *avctx, const char *font, int font_size, int color, int back_color, int bold, int italic, int underline, int border_style, int alignment)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
static float sub(float src0, float src1)
char * av_asprintf(const char *fmt,...)
#define ASS_DEFAULT_ALIGNMENT
int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, int readorder, int layer, const char *style, const char *speaker)
Add an ASS dialog to a subtitle.
uint8_t * subtitle_header
Header containing style information for text subtitles.
#define ASS_DEFAULT_BORDERSTYLE
@ SUBTITLE_ASS
Formatted text, the ass field must be set by the decoder and is authoritative.
int flags
AV_CODEC_FLAG_*.
char * ff_ass_get_dialog(int readorder, int layer, const char *style, const char *speaker, const char *text)
Craft an ASS dialog string.
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size, const char *linebreaks, int keep_ass_markup)
Escape a text subtitle using ASS syntax into an AVBPrint buffer.
int ff_ass_subtitle_header_full(AVCodecContext *avctx, int play_res_x, int play_res_y, const char *font, int font_size, int primary_color, int secondary_color, int outline_color, int back_color, int bold, int italic, int underline, int border_style, int alignment)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS.
#define ASS_DEFAULT_BACK_COLOR
#define ASS_DEFAULT_PLAYRESY
int flags2
AV_CODEC_FLAG2_*.
#define ASS_DEFAULT_PLAYRESX
#define ASS_DEFAULT_UNDERLINE
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define ASS_DEFAULT_ITALIC
#define ASS_DEFAULT_COLOR
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define ASS_DEFAULT_FONT_SIZE
main external API structure.
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.