#include "libavutil/bswap.h"#include "libavutil/crc.h"#include "libavutil/dict.h"#include "libavutil/opt.h"#include "libavutil/avassert.h"#include "libavcodec/mpegvideo.h"#include "avformat.h"#include "internal.h"#include "mpegts.h"#include "adts.h"Go to the source code of this file.
Data Structures | |
| struct | MpegTSSection |
| struct | MpegTSService |
| struct | MpegTSWrite |
| struct | MpegTSWriteStream |
Defines | |
| #define | PCR_TIME_BASE 27000000 |
| #define | DEFAULT_PROVIDER_NAME "FFmpeg" |
| #define | DEFAULT_SERVICE_NAME "Service01" |
| #define | DEFAULT_PES_HEADER_FREQ 16 |
| #define | DEFAULT_PES_PAYLOAD_SIZE ((DEFAULT_PES_HEADER_FREQ - 1) * 184 + 170) |
| #define | SDT_RETRANS_TIME 500 |
| #define | PAT_RETRANS_TIME 100 |
| #define | PCR_RETRANS_TIME 20 |
Functions | |
| static void | mpegts_write_section (MpegTSSection *s, uint8_t *buf, int len) |
| 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 | mpegts_write_pat (AVFormatContext *s) |
| static void | mpegts_write_pmt (AVFormatContext *s, MpegTSService *service) |
| static void | putstr8 (uint8_t **q_ptr, const char *str) |
| static void | mpegts_write_sdt (AVFormatContext *s) |
| static MpegTSService * | mpegts_add_service (MpegTSWrite *ts, int sid, const char *provider_name, const char *name) |
| static void | section_write_packet (MpegTSSection *s, const uint8_t *packet) |
| static int | mpegts_write_header (AVFormatContext *s) |
| static void | retransmit_si_info (AVFormatContext *s) |
| static int64_t | get_pcr (const MpegTSWrite *ts, AVIOContext *pb) |
| static uint8_t * | write_pcr_bits (uint8_t *buf, int64_t pcr) |
| static void | mpegts_insert_null_packet (AVFormatContext *s) |
| static void | mpegts_insert_pcr_only (AVFormatContext *s, AVStream *st) |
| static void | write_pts (uint8_t *q, int fourbits, int64_t pts) |
| static void | mpegts_write_pes (AVFormatContext *s, AVStream *st, const uint8_t *payload, int payload_size, int64_t pts, int64_t dts) |
| static int | mpegts_write_packet (AVFormatContext *s, AVPacket *pkt) |
| static int | mpegts_write_end (AVFormatContext *s) |
Variables | |
| static const AVOption | options [] |
| static const AVClass | mpegts_muxer_class |
| AVOutputFormat | ff_mpegts_muxer |
| #define DEFAULT_PES_HEADER_FREQ 16 |
Definition at line 191 of file mpegtsenc.c.
| #define DEFAULT_PES_PAYLOAD_SIZE ((DEFAULT_PES_HEADER_FREQ - 1) * 184 + 170) |
| #define DEFAULT_PROVIDER_NAME "FFmpeg" |
| #define DEFAULT_SERVICE_NAME "Service01" |
| #define PAT_RETRANS_TIME 100 |
| #define PCR_RETRANS_TIME 20 |
| #define PCR_TIME_BASE 27000000 |
| #define SDT_RETRANS_TIME 500 |
| static int64_t get_pcr | ( | const MpegTSWrite * | ts, | |
| AVIOContext * | pb | |||
| ) | [static] |
Definition at line 618 of file mpegtsenc.c.
Referenced by mpegts_insert_pcr_only(), and mpegts_write_pes().
| static MpegTSService* mpegts_add_service | ( | MpegTSWrite * | ts, | |
| int | sid, | |||
| const char * | provider_name, | |||
| const char * | name | |||
| ) | [static] |
| static void mpegts_insert_null_packet | ( | AVFormatContext * | s | ) | [static] |
| static void mpegts_insert_pcr_only | ( | AVFormatContext * | s, | |
| AVStream * | st | |||
| ) | [static] |
| static int mpegts_write_end | ( | AVFormatContext * | s | ) | [static] |
Definition at line 978 of file mpegtsenc.c.
| static int mpegts_write_header | ( | AVFormatContext * | s | ) | [static] |
Definition at line 442 of file mpegtsenc.c.
| static int mpegts_write_packet | ( | AVFormatContext * | s, | |
| AVPacket * | pkt | |||
| ) | [static] |
Definition at line 875 of file mpegtsenc.c.
| static void mpegts_write_pat | ( | AVFormatContext * | s | ) | [static] |
| static void mpegts_write_pes | ( | AVFormatContext * | s, | |
| AVStream * | st, | |||
| const uint8_t * | payload, | |||
| int | payload_size, | |||
| int64_t | pts, | |||
| int64_t | dts | |||
| ) | [static] |
Definition at line 697 of file mpegtsenc.c.
Referenced by mpegts_write_end(), and mpegts_write_packet().
| static void mpegts_write_pmt | ( | AVFormatContext * | s, | |
| MpegTSService * | service | |||
| ) | [static] |
| static void mpegts_write_sdt | ( | AVFormatContext * | s | ) | [static] |
| static void mpegts_write_section | ( | MpegTSSection * | s, | |
| uint8_t * | buf, | |||
| int | len | |||
| ) | [static] |
| 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] |
Definition at line 157 of file mpegtsenc.c.
Referenced by mpegts_write_pat(), mpegts_write_pmt(), and mpegts_write_sdt().
| static void put16 | ( | uint8_t ** | q_ptr, | |
| int | val | |||
| ) | [inline, static] |
Definition at line 148 of file mpegtsenc.c.
Referenced by mpegts_write_pat(), mpegts_write_pmt(), mpegts_write_sdt(), and mpegts_write_section1().
| static void putstr8 | ( | uint8_t ** | q_ptr, | |
| const char * | str | |||
| ) | [static] |
| static void retransmit_si_info | ( | AVFormatContext * | s | ) | [static] |
| static void section_write_packet | ( | MpegTSSection * | s, | |
| const uint8_t * | packet | |||
| ) | [static] |
| static uint8_t* write_pcr_bits | ( | uint8_t * | buf, | |
| int64_t | pcr | |||
| ) | [static] |
Definition at line 624 of file mpegtsenc.c.
Referenced by mpegts_insert_pcr_only(), and mpegts_write_pes().
| static void write_pts | ( | uint8_t * | q, | |
| int | fourbits, | |||
| int64_t | pts | |||
| ) | [static] |
Initial value:
{
"mpegts",
NULL_IF_CONFIG_SMALL("MPEG-2 transport stream format"),
"video/x-mpegts",
"ts,m2t",
sizeof(MpegTSWrite),
CODEC_ID_MP2,
CODEC_ID_MPEG2VIDEO,
mpegts_write_header,
mpegts_write_packet,
mpegts_write_end,
.priv_class = &mpegts_muxer_class,
}
Definition at line 1009 of file mpegtsenc.c.
const AVClass mpegts_muxer_class [static] |
Initial value:
{
.class_name = "MPEGTS muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
}
Definition at line 94 of file mpegtsenc.c.
Initial value:
{
{ "mpegts_transport_stream_id", "Set transport_stream_id field.",
0x42, FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_original_network_id", "Set original_network_id field.",
0x42, FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_service_id", "Set service_id field.",
0x42, FF_OPT_TYPE_INT, {.dbl = 0x0001 }, 0x0001, 0xffff, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_pmt_start_pid", "Set the first pid of the PMT.",
0x42, FF_OPT_TYPE_INT, {.dbl = 0x1000 }, 0x0010, 0x1f00, AV_OPT_FLAG_ENCODING_PARAM},
{ "mpegts_start_pid", "Set the first pid.",
0x42, FF_OPT_TYPE_INT, {.dbl = 0x0100 }, 0x0100, 0x0f00, AV_OPT_FLAG_ENCODING_PARAM},
{ NULL },
}
Definition at line 80 of file mpegtsenc.c.
1.5.8