FFmpeg
Data Structures | Enumerations | Functions | Variables
ttmlenc.c File Reference
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
#include "mux.h"
#include "ttmlenc.h"
#include "libavcodec/ttmlenc.h"
#include "libavutil/internal.h"

Go to the source code of this file.

Data Structures

struct  TTMLHeaderParameters
 
struct  TTMLMuxContext
 

Enumerations

enum  TTMLPacketType { PACKET_TYPE_PARAGRAPH, PACKET_TYPE_DOCUMENT }
 

Functions

static void ttml_write_time (AVIOContext *pb, const char tag[], int64_t millisec)
 
static int ttml_set_header_values_from_extradata (AVCodecParameters *par, struct TTMLHeaderParameters *header_params)
 
static int ttml_write_header (AVFormatContext *ctx)
 
static int ttml_write_packet (AVFormatContext *ctx, AVPacket *pkt)
 
static int ttml_write_trailer (AVFormatContext *ctx)
 

Variables

static const char ttml_header_text []
 
static const char ttml_footer_text []
 
const FFOutputFormat ff_ttml_muxer
 

Detailed Description

TTML subtitle muxer

See also
https://www.w3.org/TR/ttml1/
https://www.w3.org/TR/ttml2/
https://www.w3.org/TR/ttml-imsc/rec

Definition in file ttmlenc.c.

Enumeration Type Documentation

◆ TTMLPacketType

Enumerator
PACKET_TYPE_PARAGRAPH 
PACKET_TYPE_DOCUMENT 

Definition at line 38 of file ttmlenc.c.

Function Documentation

◆ ttml_write_time()

static void ttml_write_time ( AVIOContext pb,
const char  tag[],
int64_t  millisec 
)
static

Definition at line 67 of file ttmlenc.c.

Referenced by ttml_write_packet().

◆ ttml_set_header_values_from_extradata()

static int ttml_set_header_values_from_extradata ( AVCodecParameters par,
struct TTMLHeaderParameters header_params 
)
static

Definition at line 82 of file ttmlenc.c.

Referenced by ttml_write_header().

◆ ttml_write_header()

static int ttml_write_header ( AVFormatContext ctx)
static

Definition at line 124 of file ttmlenc.c.

◆ ttml_write_packet()

static int ttml_write_packet ( AVFormatContext ctx,
AVPacket pkt 
)
static

Definition at line 170 of file ttmlenc.c.

◆ ttml_write_trailer()

static int ttml_write_trailer ( AVFormatContext ctx)
static

Definition at line 208 of file ttmlenc.c.

Variable Documentation

◆ ttml_header_text

const char ttml_header_text[]
static
Initial value:
=
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<tt\n"
"%s"
" xml:lang=\"%s\">\n"
"%s"
" <body>\n"
" <div>\n"

Definition at line 53 of file ttmlenc.c.

Referenced by ttml_write_header().

◆ ttml_footer_text

const char ttml_footer_text[]
static
Initial value:
=
" </div>\n"
" </body>\n"
"</tt>\n"

Definition at line 62 of file ttmlenc.c.

Referenced by ttml_write_trailer().

◆ ff_ttml_muxer

const FFOutputFormat ff_ttml_muxer
Initial value:
= {
.p.name = "ttml",
.p.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"),
.p.extensions = "ttml",
.p.mime_type = "text/ttml",
.priv_data_size = sizeof(TTMLMuxContext),
.p.subtitle_codec = AV_CODEC_ID_TTML,
.write_header = ttml_write_header,
.write_packet = ttml_write_packet,
.write_trailer = ttml_write_trailer,
}

Definition at line 219 of file ttmlenc.c.

ttml_write_trailer
static int ttml_write_trailer(AVFormatContext *ctx)
Definition: ttmlenc.c:208
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:483
ttml_write_packet
static int ttml_write_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: ttmlenc.c:170
TTMLMuxContext
Definition: ttmlenc.c:48
ttml_write_header
static int ttml_write_header(AVFormatContext *ctx)
Definition: ttmlenc.c:124
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
AVFMT_GLOBALHEADER
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition: avformat.h:479
AV_CODEC_ID_TTML
@ AV_CODEC_ID_TTML
Definition: codec_id.h:574
AVFMT_TS_NONSTRICT
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition: avformat.h:492