77 for (
i = 0;
i <
s->nb_streams;
i++) {
83 st->
id =
s->streams[
i]->id;
96 for (
i = 0;
i <
s->nb_streams;
i++)
159 local_pkt->
data = buf;
164 s->streams[
pkt->stream_index]->time_base,
168 s->streams[
pkt->stream_index]->time_base,
176#define OFFSET(x) offsetof(MuxChain, x)
177#define E AV_OPT_FLAG_ENCODING_PARAM
179 {
"mpegts_muxer_options",
"set list of options for the MPEG-TS muxer",
OFFSET(mpegts_muxer_options),
AV_OPT_TYPE_DICT, {.str =
NULL}, 0, 0,
E },
180 {
"rtp_muxer_options",
"set list of options for the RTP muxer",
OFFSET(rtp_muxer_options),
AV_OPT_TYPE_DICT, {.str =
NULL}, 0, 0,
E },
185 .class_name =
"rtp_mpegts muxer",
192 .p.name =
"rtp_mpegts",
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
#define i(width, name, range_min, range_max)
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src)
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
@ AV_CODEC_ID_MPEG2TS
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
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.
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
const char * av_default_item_name(void *ptr)
Return the context name.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Memory handling functions.
static const AVClass rtp_mpegts_class
static int rtp_mpegts_write_header(AVFormatContext *s)
static int rtp_mpegts_write_close(AVFormatContext *s)
static int rtp_mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
Describe the class of an AVClass context structure.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
AVIOContext * pb
I/O context.
AVDictionary * metadata
Metadata that applies to the whole file.
const struct AVOutputFormat * oformat
The output container format.
AVStream ** streams
A list of all streams in the file.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int id
Format-specific stream ID.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented.
AVFormatContext * mpegts_ctx
AVDictionary * mpegts_muxer_options
AVFormatContext * rtp_ctx
AVDictionary * rtp_muxer_options