30 const char *font,
int font_size,
31 int color,
int back_color,
32 int bold,
int italic,
int underline,
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",
70 font, font_size, color, color, back_color, back_color,
71 -bold, -italic, -underline, alignment);
98 h = ts/360000; ts -= 360000*h;
99 m = ts/ 6000; ts -= 6000*
m;
100 s = ts/ 100; ts -= 100*
s;
101 av_bprintf(buf,
"%d:%02d:%02d.%02d,", h, m, s, ts);
106 int ts_start,
int duration,
int raw)
110 if (!raw || raw == 2) {
115 dialog = strchr(dialog,
',');
121 layer = strtol(dialog, (
char**)&dialog, 10);
128 insert_ts(buf, duration == -1 ? -1 : ts_start + duration);
133 dlen = strcspn(dialog,
"\n");
134 dlen += dialog[dlen] ==
'\n';
144 int ts_start,
int duration,
int raw)
187 const char *linebreaks,
int keep_ass_markup)
189 const char *p_end = p +
size;
191 for (; p < p_end && *p; p++) {
194 if (linebreaks && strchr(linebreaks, *p)) {
199 }
else if (!keep_ass_markup && strchr(
"{}\\", *p)) {
208 }
else if (p[0] ==
'\n') {
212 }
else if (p[0] ==
'\r' && p < p_end - 1 && p[1] ==
'\n') {