FFmpeg
Data Structures | Enumerations | Functions | Variables
ttmlenc.c File Reference
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.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 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 37 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 66 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 81 of file ttmlenc.c.

Referenced by ttml_write_header().

◆ ttml_write_header()

static int ttml_write_header ( AVFormatContext ctx)
static

Definition at line 123 of file ttmlenc.c.

◆ ttml_write_packet()

static int ttml_write_packet ( AVFormatContext ctx,
AVPacket pkt 
)
static

Definition at line 169 of file ttmlenc.c.

◆ ttml_write_trailer()

static int ttml_write_trailer ( AVFormatContext ctx)
static

Definition at line 207 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 52 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 61 of file ttmlenc.c.

Referenced by ttml_write_trailer().

◆ ff_ttml_muxer

const 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 218 of file ttmlenc.c.

ttml_write_trailer
static int ttml_write_trailer(AVFormatContext *ctx)
Definition: ttmlenc.c:207
AVFMT_VARIABLE_FPS
#define AVFMT_VARIABLE_FPS
Format allows variable fps.
Definition: avformat.h:478
ttml_write_packet
static int ttml_write_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: ttmlenc.c:169
TTMLMuxContext
Definition: ttmlenc.c:47
ttml_write_header
static int ttml_write_header(AVFormatContext *ctx)
Definition: ttmlenc.c:123
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:727
AVFMT_GLOBALHEADER
#define AVFMT_GLOBALHEADER
Format wants global header.
Definition: avformat.h:474
AV_CODEC_ID_TTML
@ AV_CODEC_ID_TTML
Definition: codec_id.h:546
AVFMT_TS_NONSTRICT
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition: avformat.h:485
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
write_header
static void write_header(FFV1Context *f)
Definition: ffv1enc.c:347