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

Go to the source code of this file.

Data Structures

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_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 []
 
AVOutputFormat 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 35 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 60 of file ttmlenc.c.

Referenced by ttml_write_packet().

◆ ttml_write_header()

static int ttml_write_header ( AVFormatContext ctx)
static

Definition at line 75 of file ttmlenc.c.

◆ ttml_write_packet()

static int ttml_write_packet ( AVFormatContext ctx,
AVPacket pkt 
)
static

Definition at line 113 of file ttmlenc.c.

◆ ttml_write_trailer()

static int ttml_write_trailer ( AVFormatContext ctx)
static

Definition at line 151 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"
" xmlns=\"http://www.w3.org/ns/ttml\"\n"
" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n"
" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n"
" xml:lang=\"%s\">\n"
" <body>\n"
" <div>\n"

Definition at line 45 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 55 of file ttmlenc.c.

Referenced by ttml_write_trailer().

◆ ff_ttml_muxer

AVOutputFormat ff_ttml_muxer
Initial value:
= {
.name = "ttml",
.long_name = NULL_IF_CONFIG_SMALL("TTML subtitle"),
.extensions = "ttml",
.mime_type = "text/ttml",
.priv_data_size = sizeof(TTMLMuxContext),
.subtitle_codec = AV_CODEC_ID_TTML,
}

Definition at line 162 of file ttmlenc.c.

ttml_write_trailer
static int ttml_write_trailer(AVFormatContext *ctx)
Definition: ttmlenc.c:151
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:465
ttml_write_packet
static int ttml_write_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: ttmlenc.c:113
TTMLMuxContext
Definition: ttmlenc.c:40
ttml_write_header
static int ttml_write_header(AVFormatContext *ctx)
Definition: ttmlenc.c:75
write_trailer
static int write_trailer(AVFormatContext *s1)
Definition: v4l2enc.c:98
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:117
write_packet
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
Definition: ffmpeg.c:729
AVFMT_GLOBALHEADER
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition: avformat.h:461
AV_CODEC_ID_TTML
@ AV_CODEC_ID_TTML
Definition: codec_id.h:548
AVFMT_TS_NONSTRICT
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition: avformat.h:472
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:346