Go to the documentation of this file.
56 uint8_t *trailer = strstr(par->
extradata,
"\n[Events]");
59 trailer = strstr(trailer,
"Format:");
61 trailer = strstr(trailer,
"\n");
64 header_size = (++trailer - par->
extradata);
73 if (!strstr(par->
extradata,
"\n[Events]"))
74 avio_printf(
s->pb,
"[Events]\nFormat: %s, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n",
107 av_log(
s,
AV_LOG_DEBUG,
"wrote %d ASS lines, cached dialogues: %d, waiting for event id %d\n",
137 prev->
next = dialogue;
138 dialogue->
prev = prev;
144 next->
prev = dialogue;
145 dialogue->
next = next;
160 int hh1, mm1, ss1, ms1;
161 int hh2, mm2, ss2, ms2;
174 if (ass->
ssa_mode && !strncmp(p,
"Marked=", 7))
177 layer = strtol(p, &p, 10);
180 hh1 = (
int)(start / 360000); mm1 = (
int)(start / 6000) % 60;
181 hh2 = (
int)(end / 360000); mm2 = (
int)(end / 6000) % 60;
182 ss1 = (
int)(start / 100) % 60; ms1 = (
int)(start % 100);
183 ss2 = (
int)(end / 100) % 60; ms2 = (
int)(end % 100);
184 if (hh1 > 9) hh1 = 9, mm1 = 59, ss1 = 59, ms1 = 99;
185 if (hh2 > 9) hh2 = 9, mm2 = 59, ss2 = 59, ms2 = 99;
187 text_len = strlen(p);
188 while (text_len > 0 && p[text_len - 1] ==
'\r' || p[text_len - 1] ==
'\n')
191 dialogue->
line =
av_asprintf(
"%s%ld,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,%.*s",
193 layer, hh1, mm1, ss1, ms1, hh2, mm2, ss2, ms2, text_len, p);
194 if (!dialogue->
line) {
217 #define OFFSET(x) offsetof(ASSContext, x)
218 #define E AV_OPT_FLAG_ENCODING_PARAM
220 {
"ignore_readorder",
"write events immediately, even if they're out-of-order",
OFFSET(ignore_readorder),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
E },
234 .p.mime_type =
"text/x-ass",
235 .p.extensions =
"ass,ssa",
#define AV_LOG_WARNING
Something somehow does not look correct.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
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
This struct describes the properties of an encoded stream.
char * av_asprintf(const char *fmt,...)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
struct DialogueLine * prev
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
#define avio_print(s,...)
Write strings (const char *) to the context.
const char * av_default_item_name(void *ptr)
Return the context name.
struct DialogueLine * next
int extradata_size
Size of the extradata content in bytes.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
void ffio_write_lines(AVIOContext *s, const unsigned char *buf, int size, const unsigned char *ending)
Write a sequence of text lines, converting line endings.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
Writes a formatted string to the context.
This structure stores compressed data.
DialogueLine * last_added_dialogue
DialogueLine * dialogue_cache