37 #define PCR_TIME_BASE 27000000 41 #define DVB_PRIVATE_NETWORK_START 0xff01 104 #define MPEGTS_FLAG_REEMIT_PAT_PMT 0x01 105 #define MPEGTS_FLAG_AAC_LATM 0x02 106 #define MPEGTS_FLAG_PAT_PMT_AT_FRAMES 0x04 107 #define MPEGTS_FLAG_SYSTEM_B 0x08 108 #define MPEGTS_FLAG_DISCONT 0x10 121 #define DEFAULT_PES_HEADER_FREQ 16 122 #define DEFAULT_PES_PAYLOAD_SIZE ((DEFAULT_PES_HEADER_FREQ - 1) * 184 + 170) 126 #define SECTION_LENGTH 1020 133 const unsigned char *buf_ptr;
135 int first,
b, len1, left;
140 buf[len - 4] = (crc >> 24) & 0xff;
141 buf[len - 3] = (crc >> 16) & 0xff;
142 buf[len - 2] = (crc >> 8) & 0xff;
143 buf[len - 1] = crc & 0xff;
148 first = buf == buf_ptr;
156 s->
cc = s->
cc + 1 & 0xf;
169 memcpy(q, buf_ptr, len1);
174 memset(q, 0xff, left);
193 int version,
int sec_num,
int last_sec_num,
197 unsigned int tot_len;
201 tot_len = 3 + 5 + len + 4;
208 put16(&q, flags | (len + 5 + 4));
210 *q++ = 0xc1 | (version << 1);
222 #define DEFAULT_PROVIDER_NAME "FFmpeg" 223 #define DEFAULT_SERVICE_NAME "Service01" 226 #define SDT_RETRANS_TIME 500 227 #define PAT_RETRANS_TIME 100 228 #define PCR_RETRANS_TIME 20 269 memcpy(*q_ptr, buf, len);
289 int val, stream_type,
i, err = 0;
294 program_info_length_ptr = q;
299 val = 0xf000 | (q - program_info_length_ptr - 2);
300 program_info_length_ptr[0] = val >> 8;
301 program_info_length_ptr[1] =
val;
432 static const uint8_t coupled_stream_counts[9] = {
433 1, 0, 1, 1, 2, 2, 2, 3, 3
435 static const uint8_t channel_map_a[8][8] = {
442 {0, 4, 1, 2, 3, 5, 6},
443 {0, 6, 1, 2, 3, 4, 5, 7},
445 static const uint8_t channel_map_b[8][8] = {
452 {0, 1, 2, 3, 4, 5, 6},
453 {0, 1, 2, 3, 4, 5, 6, 7},
487 char *next = lang->
value;
494 for (p = lang->
value; next && *len_ptr < 255 / 4 * 4; p = next + 1) {
499 next = strchr(p,
',');
500 if (strlen(p) != 3 && (!next || next != p + 3))
525 const char default_language[] =
"und";
526 const char *language = lang && strlen(lang->
value) >= 3 ? lang->
value : default_language;
530 int extradata_copied = 0;
535 while (strlen(language) >= 3) {
536 if (
sizeof(data) - (q - data) < 8) {
544 if (*language !=
'\0')
550 extradata_copied += 5;
560 extradata_copied += 4;
569 *len_ptr = q - len_ptr - 1;
572 int extradata_copied = 0;
578 while (strlen(language) >= 3 && q - data <
sizeof(data) - 6) {
583 if (*language !=
'\0')
588 extradata_copied += 2;
600 *len_ptr = q - len_ptr - 1;
617 const char *
tag =
"ID3 ";
621 putbuf(&q, tag, strlen(tag));
623 putbuf(&q, tag, strlen(tag));
630 val = 0xf000 | (q - desc_length_ptr - 2);
631 desc_length_ptr[0] = val >> 8;
632 desc_length_ptr[1] =
val;
637 "The PMT section cannot fit stream %d and all following streams.\n" 638 "Try reducing the number of languages in the audio streams " 639 "or the total number of streams.\n", i);
651 int i, running_status, free_ca_mode,
val;
660 desc_list_len_ptr = q;
672 desc_len_ptr[0] = q - desc_len_ptr - 1;
675 val = (running_status << 13) | (free_ca_mode << 12) |
676 (q - desc_list_len_ptr - 2);
677 desc_list_len_ptr[0] = val >> 8;
678 desc_list_len_ptr[1] =
val;
693 str_len = strlen(str);
694 if (str[0] && (
unsigned)str[0] >= 0x20) {
696 int has_multibyte = 0;
700 has_multibyte |= (code > 127);
705 buf[0] = str_len + 1;
707 memcpy(&buf[2], str, str_len);
716 memcpy(&buf[1], str, str_len);
758 uint32_t tp_extra_header = pcr % 0x3fffffff;
759 tp_extra_header =
AV_RB32(&tp_extra_header);
761 sizeof(tp_extra_header));
780 const char *service_name;
802 provider_name, service_name);
809 service->
pmt.
cc = 15;
821 provider_name, service_name);
828 service->
pmt.
cc = 15;
890 }
else if (st->
id < 0x1FFF) {
894 "Invalid stream id %d, must be less than 8191\n", st->
id);
903 for (j = 0; j <
i; j++) {
904 if (pids[j] == ts_st->
pid) {
910 pids[
i] = ts_st->
pid;
1018 "pcr every %d pkts, sdt every %d, pat/pmt every %d pkts\n",
1067 int64_t pcr_low = pcr % 300, pcr_high = pcr / 300;
1069 *buf++ = pcr_high >> 25;
1070 *buf++ = pcr_high >> 17;
1071 *buf++ = pcr_high >> 9;
1072 *buf++ = pcr_high >> 1;
1073 *buf++ = pcr_high << 7 | pcr_low >> 8 | 0x7e;
1105 *q++ = ts_st->
pid >> 8;
1107 *q++ = 0x20 | ts_st->
cc;
1129 val = fourbits << 4 | (((pts >> 30) & 0x07) << 1) | 1;
1131 val = (((pts >> 15) & 0x7fff) << 1) | 1;
1134 val = (((
pts) & 0x7fff) << 1) | 1;
1145 if ((pkt[3] & 0x20) == 0) {
1167 return pkt + 5 + pkt[4];
1177 const uint8_t *payload,
int payload_size,
1178 int64_t
pts, int64_t dts,
int key,
int stream_id)
1184 int val, is_start,
len, header_len, write_pcr, is_dvb_subtitle, is_dvb_teletext,
flags;
1185 int afc_len, stuffing_len;
1196 while (payload_size > 0) {
1212 (dts -
get_pcr(ts, s->
pb) / 300) > delay) {
1225 val = ts_st->
pid >> 8;
1230 ts_st->
cc = ts_st->
cc + 1 & 0xf;
1231 *q++ = 0x10 | ts_st->
cc;
1251 pcr = (dts - delay) * 300;
1258 int pes_extension = 0;
1259 int pes_header_stuffing_bytes = 0;
1264 is_dvb_subtitle = 0;
1265 is_dvb_teletext = 0;
1284 *q++ = stream_id != -1 ? stream_id : 0xfc;
1286 if (stream_id == 0xbd)
1292 is_dvb_subtitle = 1;
1294 is_dvb_teletext = 1;
1330 if (is_dvb_teletext) {
1331 pes_header_stuffing_bytes = 0x24 - header_len;
1334 len = payload_size + header_len + 3;
1336 if (is_dvb_subtitle) {
1381 if (is_dvb_subtitle) {
1388 if (is_dvb_teletext) {
1389 memset(q, 0xff, pes_header_stuffing_bytes);
1390 q += pes_header_stuffing_bytes;
1395 header_len = q -
buf;
1398 if (len > payload_size)
1401 if (stuffing_len > 0) {
1403 if (buf[3] & 0x20) {
1405 afc_len = buf[4] + 1;
1406 memmove(buf + 4 + afc_len + stuffing_len,
1408 header_len - (4 + afc_len));
1409 buf[4] += stuffing_len;
1410 memset(buf + 4 + afc_len, 0xff, stuffing_len);
1413 memmove(buf + 4 + stuffing_len, buf + 4, header_len - 4);
1415 buf[4] = stuffing_len - 1;
1416 if (stuffing_len >= 2) {
1418 memset(buf + 6, 0xff, stuffing_len - 2);
1423 if (is_dvb_subtitle && payload_size == len) {
1431 payload_size -=
len;
1443 "no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it " 1444 "('-bsf:v h264_mp4toannexb' option with ffmpeg)\n");
1476 static const int durations[32] = {
1477 480, 960, 1920, 2880,
1478 480, 960, 1920, 2880,
1479 480, 960, 1920, 2880,
1487 int toc, frame_duration, nframes,
duration;
1494 frame_duration = durations[toc >> 3];
1508 nframes = pkt->
data[1] & 63;
1512 duration = nframes * frame_duration;
1513 if (duration > 5760) {
1515 "Opus packet duration > 120 ms, invalid");
1532 int opus_samples = 0;
1541 stream_id = side_data[0];
1545 "resend_headers option is deprecated, use -mpegts_flags resend_headers\n");
1571 uint32_t
state = -1;
1583 if ((state & 0x1f) == 7)
1585 }
while (p < buf_end && (state & 0x1f) != 9 &&
1586 (state & 0x1f) != 5 && (state & 0x1f) != 1);
1588 if ((state & 0x1f) != 5)
1590 if ((state & 0x1f) != 9) {
1595 memcpy(data + 6 + extradd, pkt->
data, pkt->
size);
1600 size = pkt->
size + 6 + extradd;
1603 if (pkt->
size < 2) {
1613 "and extradata missing\n");
1637 uint32_t
state = -1;
1649 if ((state & 0x7e) == 2*32)
1651 }
while (p < buf_end && (state & 0x7e) != 2*35 &&
1652 (state & 0x7e) >= 2*32);
1654 if ((state & 0x7e) < 2*16 && (state & 0x7e) >= 2*24)
1656 if ((state & 0x7e) != 2*35) {
1661 memcpy(data + 7 + extradd, pkt->
data, pkt->
size);
1667 size = pkt->
size + 7 + extradd;
1670 if (pkt->
size < 2) {
1680 int ctrl_header_size;
1681 int trim_start = 0, trim_end = 0;
1689 if (side_data && side_data_size >= 10) {
1693 ctrl_header_size = pkt->
size + 2 + pkt->
size / 255 + 1;
1695 ctrl_header_size += 2;
1697 ctrl_header_size += 2;
1722 AV_WB16(data + i, trim_start);
1727 trim_end =
FFMIN(trim_end, opus_samples - trim_start);
1732 memcpy(data + i, pkt->
data, pkt->
size);
1734 size = ctrl_header_size;
1878 {
"mpegts_transport_stream_id",
"Set transport_stream_id field.",
1881 {
"mpegts_original_network_id",
"Set original_network_id field.",
1884 {
"mpegts_service_id",
"Set service_id field.",
1886 { .i64 = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM },
1887 {
"mpegts_service_type",
"Set service_type field.",
1890 {
"digital_tv",
"Digital Television.",
1893 {
"digital_radio",
"Digital Radio.",
1896 {
"teletext",
"Teletext.",
1899 {
"advanced_codec_digital_radio",
"Advanced Codec Digital Radio.",
1902 {
"mpeg2_digital_hdtv",
"MPEG2 Digital HDTV.",
1905 {
"advanced_codec_digital_sdtv",
"Advanced Codec Digital SDTV.",
1908 {
"advanced_codec_digital_hdtv",
"Advanced Codec Digital HDTV.",
1911 {
"hevc_digital_hdtv",
"HEVC Digital Television Service.",
1914 {
"mpegts_pmt_start_pid",
"Set the first pid of the PMT.",
1916 { .i64 = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM },
1917 {
"mpegts_start_pid",
"Set the first pid.",
1919 { .i64 = 0x0100 }, 0x0010, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM },
1920 {
"mpegts_m2ts_mode",
"Enable m2ts mode.",
1922 { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM },
1925 { .i64 = 1 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
1926 {
"pes_payload_size",
"Minimum PES packet payload in bytes",
1929 {
"mpegts_flags",
"MPEG-TS muxing flags",
1932 {
"resend_headers",
"Reemit PAT/PMT before writing the next packet",
1935 {
"latm",
"Use LATM packetization for AAC",
1938 {
"pat_pmt_at_frames",
"Reemit PAT and PMT at each video frame",
1941 {
"system_b",
"Conform to System B (DVB) instead of System A (ATSC)",
1944 {
"initial_discontinuity",
"Mark initial packets as discontinuous",
1948 {
"resend_headers",
"Reemit PAT/PMT before writing the next packet",
1950 { .i64 = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
1951 {
"mpegts_copyts",
"don't offset dts/pts",
1953 { .i64 = -1 }, -1, 1, AV_OPT_FLAG_ENCODING_PARAM },
1954 {
"tables_version",
"set PAT, PMT and SDT version",
1956 { .i64 = 0 }, 0, 31, AV_OPT_FLAG_ENCODING_PARAM },
1957 {
"omit_video_pes_length",
"Omit the PES packet length for video packets",
1959 { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
1960 {
"pcr_period",
"PCR retransmission time in milliseconds",
1963 {
"pat_period",
"PAT/PMT retransmission time limit in seconds",
1965 { .dbl = INT_MAX }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
1966 {
"sdt_period",
"SDT retransmission time limit in seconds",
1968 { .dbl = INT_MAX }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
1982 .mime_type =
"video/MP2T",
1983 .extensions =
"ts,m2t,m2ts,mts",
1993 .priv_class = &mpegts_muxer_class,
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
#define STREAM_TYPE_AUDIO_MPEG2
uint8_t provider_name[256]
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
#define STREAM_TYPE_VIDEO_CAVS
static av_cold int init(AVCodecContext *avctx)
static void put_registration_descriptor(uint8_t **q_ptr, uint32_t tag)
static int mpegts_init(AVFormatContext *s)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const char * av_default_item_name(void *ptr)
Return the context name.
#define STREAM_TYPE_AUDIO_EAC3
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int strict_std_compliance
Allow non-standard and experimental extension.
#define MPEGTS_FLAG_DISCONT
int first_pts_check
first pts check needed
unsigned int nb_stream_indexes
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
Opaque data information usually continuous.
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
#define DEFAULT_PES_PAYLOAD_SIZE
int id
Format-specific stream ID.
#define STREAM_TYPE_VIDEO_HEVC
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
static int mpegts_check_bitstream(struct AVFormatContext *s, const AVPacket *pkt)
AVStream ** streams
A list of all streams in the file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
Public header for CRC hash function implementation.
static int encode_str8(uint8_t *buf, const char *str)
int initial_padding
Audio only.
int omit_video_pes_length
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
static void mpegts_insert_null_packet(AVFormatContext *s)
#define AV_LOG_VERBOSE
Detailed information.
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
int av_dynarray_add_nofree(void *tab_ptr, int *nb_ptr, void *elem)
Add an element to a dynamic array.
static void mpegts_write_sdt(AVFormatContext *s)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
#define STREAM_TYPE_VIDEO_VC1
static void extend_af(uint8_t *pkt, int size)
unsigned int * stream_index
#define MPEGTS_FLAG_AAC_LATM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
const uint8_t * avpriv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define STREAM_TYPE_AUDIO_AAC
MPEGTS stream ID as uint8_t, this is required to pass the stream ID information from the demuxer to t...
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
struct MpegTSService * service
#define STREAM_TYPE_AUDIO_DTS
static void mpegts_write_pes(AVFormatContext *s, AVStream *st, const uint8_t *payload, int payload_size, int64_t pts, int64_t dts, int key, int stream_id)
AVProgram * av_find_program_from_stream(AVFormatContext *ic, AVProgram *last, int s)
Find the programs which belong to a given stream.
static void mpegts_prefix_m2ts_header(AVFormatContext *s)
#define i(width, name, range_min, range_max)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
Copy the contents of src to dst.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVDictionary * metadata
Metadata that applies to the whole file.
static void put16(uint8_t **q_ptr, int val)
static int mpegts_write_section1(MpegTSSection *s, int tid, int id, int version, int sec_num, int last_sec_num, uint8_t *buf, int len)
static void write_pts(uint8_t *q, int fourbits, int64_t pts)
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, int *size)
Get side information from packet.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static uint8_t * get_ts_payload_start(uint8_t *pkt)
char * url
input or output URL.
#define STREAM_TYPE_VIDEO_DIRAC
static void set_af_flag(uint8_t *pkt, int flag)
preferred ID for decoding MPEG audio layer 1, 2 or 3
enum AVMediaType codec_type
General type of the encoded data.
static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st)
simple assert() macros that are a bit more flexible than ISO C assert().
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int mux_rate
set to 1 when VBR
static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
New fields can be added to the end with minor version bumps.
static int write_pcr_bits(uint8_t *buf, int64_t pcr)
static MpegTSService * mpegts_add_service(AVFormatContext *s, int sid, const char *provider_name, const char *name)
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
#define MPEGTS_FLAG_SYSTEM_B
int flags
A combination of AV_PKT_FLAG values.
int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b)
Compare two timestamps each in its own time base.
int extradata_size
Size of the extradata content in bytes.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
#define STREAM_TYPE_AUDIO_AAC_LATM
int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt)
Check presence of H264 startcode.
static const AVOption options[]
int64_t av_rescale(int64_t a, int64_t b, int64_t c)
Rescale a 64-bit integer with rounding to nearest.
#define AV_TIME_BASE
Internal time base represented as integer.
av_warn_unused_result int avformat_write_header(AVFormatContext *s, AVDictionary **options)
Allocate the stream private data and write the stream header to an output media file.
#define STREAM_TYPE_VIDEO_H264
static int write_trailer(AVFormatContext *s1)
#define DEFAULT_PROVIDER_NAME
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
static int check_hevc_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt)
AVOutputFormat ff_mpegts_muxer
#define MPEGTS_FLAG_REEMIT_PAT_PMT
preferred ID for MPEG-1/2 video decoding
#define STREAM_TYPE_VIDEO_MPEG4
static void mpegts_deinit(AVFormatContext *s)
ff_const59 struct AVOutputFormat * oformat
The output container format.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
void(* write_packet)(struct MpegTSSection *s, const uint8_t *packet)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define STREAM_TYPE_METADATA
#define DVB_PRIVATE_NETWORK_START
typedef void(RENAME(mix_any_func_type))
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
#define MPEGTS_FLAG_PAT_PMT_AT_FRAMES
#define STREAM_TYPE_PRIVATE_DATA
Describe the class of an AVClass context structure.
static int opus_get_packet_samples(AVFormatContext *s, AVPacket *pkt)
#define FF_COMPLIANCE_NORMAL
ff_const59 AVOutputFormat * av_guess_format(const char *short_name, const char *filename, const char *mime_type)
Return the output format in the list of registered output formats which best matches the provided par...
Rational number (pair of numerator and denominator).
Recommmends skipping the specified number of samples.
static int mpegts_write_end(AVFormatContext *s)
#define STREAM_TYPE_AUDIO_AC3
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
static void retransmit_si_info(AVFormatContext *s, int force_pat, int64_t dts)
MpegTSService ** services
static void section_write_packet(MpegTSSection *s, const uint8_t *packet)
static void mpegts_write_flush(AVFormatContext *s)
#define flags(name, subs,...)
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
int sample_rate
Audio only.
#define DEFAULT_SERVICE_NAME
common internal api header.
static int64_t get_pcr(const MpegTSWrite *ts, AVIOContext *pb)
int disposition
AV_DISPOSITION_* bit field.
static void putbuf(uint8_t **q_ptr, const uint8_t *buf, size_t len)
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
int64_t nb_frames
number of frames in this stream if known or 0
#define STREAM_TYPE_VIDEO_MPEG2
void * priv_data
Format private data.
static void mpegts_write_pat(AVFormatContext *s)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static const AVClass mpegts_muxer_class
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define av_malloc_array(a, b)
int opus_pending_trim_start
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
#define MKTAG(a, b, c, d)
#define STREAM_TYPE_AUDIO_MPEG1
This structure stores compressed data.
static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define STREAM_TYPE_AUDIO_TRUEHD