30 const char *font,
int font_size,
31 int color,
int back_color,
32 int bold,
int italic,
int underline,
33 int border_style,
int alignment)
37 "; Script generated by FFmpeg/Lavc%s\r\n" 38 "ScriptType: v4.00+\r\n" 46 "Fontname, Fontsize, " 47 "PrimaryColour, SecondaryColour, OutlineColour, BackColour, " 48 "Bold, Italic, Underline, StrikeOut, " 51 "BorderStyle, Outline, Shadow, " 52 "Alignment, MarginL, MarginR, MarginV, " 58 "&H%x,&H%x,&H%x,&H%x," 68 "Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\r\n",
71 font, font_size, color, color, back_color, back_color,
72 -bold, -italic, -underline, border_style, alignment);
94 const char *speaker,
const char *text)
97 readorder, layer, style ? style :
"Default",
98 speaker ? speaker :
"", text);
102 int readorder,
int layer,
const char *style,
132 const char *linebreaks,
int keep_ass_markup)
134 const char *p_end = p +
size;
136 for (; p < p_end && *p; p++) {
139 if (linebreaks && strchr(linebreaks, *p)) {
144 }
else if (!keep_ass_markup && strchr(
"{}\\", *p)) {
153 }
else if (p[0] ==
'\n') {
157 }
else if (p[0] ==
'\r' && p < p_end - 1 && p[1] ==
'\n') {
void av_bprintf(AVBPrint *buf, const char *fmt,...)
#define ASS_DEFAULT_BORDERSTYLE
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.
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.
#define ASS_DEFAULT_ALIGNMENT
int ff_ass_subtitle_header_default(AVCodecContext *avctx)
Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS with default style.
#define AV_CODEC_FLAG2_RO_FLUSH_NOOP
Do not reset ASS ReadOrder field on flush (subtitles decoding)
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array.
#define ASS_DEFAULT_PLAYRESY
#define ASS_DEFAULT_BACK_COLOR
#define ASS_DEFAULT_UNDERLINE
char * ff_ass_get_dialog(int readorder, int layer, const char *style, const char *speaker, const char *text)
Craft an ASS dialog string.
int flags
AV_CODEC_FLAG_*.
simple assert() macros that are a bit more flexible than ISO C assert().
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
#define ASS_DEFAULT_FONT_SIZE
char * av_asprintf(const char *fmt,...)
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Libavcodec external API header.
main external API structure.
void ff_ass_decoder_flush(AVCodecContext *avctx)
Helper to flush a text subtitles decoder making use of the FFASSDecoderContext.
#define LIBAVCODEC_VERSION
common internal and external API header
#define ASS_DEFAULT_COLOR
Formatted text, the ass field must be set by the decoder and is authoritative.
#define ASS_DEFAULT_ITALIC
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.
char * ass
0 terminated ASS/SSA compatible event line.
int flags2
AV_CODEC_FLAG2_*.
#define ASS_DEFAULT_PLAYRESX
uint8_t * subtitle_header
Header containing style information for text subtitles.
void av_bprint_chars(AVBPrint *buf, char c, unsigned n)
Append char c n times to a print buffer.