102 i < seg->number; i++) {
168 int buf_size = 32768;
209 "More than a single video stream present, "
210 "expect issues decoding it.\n");
282 int ret, can_split = 1;
362 #define OFFSET(x) offsetof(SegmentContext, x)
363 #define E AV_OPT_FLAG_ENCODING_PARAM
374 {
"individual_header_trailer",
"write header/trailer to each segment",
OFFSET(individual_header_trailer),
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1,
E },
375 {
"write_header_trailer",
"write a header to the first segment and a trailer to the last one",
OFFSET(write_header_trailer),
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1,
E },
395 .priv_class = &seg_class,
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
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_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file.
#define AV_LOG_WARNING
Something somehow does not look correct.
char * entry_prefix
Set by a private option.
static int segment_start(AVFormatContext *s, int write_header)
int size
Set by a private option.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
#define AVIO_FLAG_WRITE
write-only
unsigned char * buffer
Start of the buffer.
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
Copy the settings of the source AVCodecContext into the destination AVCodecContext.
static int seg_write_header(AVFormatContext *s)
static void close_null_ctx(AVIOContext *pb)
static int segment_mux_init(AVFormatContext *s)
static int segment_hls_window(AVFormatContext *s, int last)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int wrap
Set by a private option.
static int seg_write_trailer(struct AVFormatContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
#define AV_LOG_VERBOSE
Detailed information.
char * format
Set by a private option.
struct AVOutputFormat * oformat
The output container format.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
int individual_header_trailer
Set by a private option.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int avio_close(AVIOContext *s)
Close the resource accessed by the AVIOContext s and free it.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_log(void *avcl, int level, const char *fmt,...)
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 2 timestamps each in its own timebases.
AVCodecContext * codec
Codec context associated with this stream.
float time
Set by a private option.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int void avio_flush(AVIOContext *s)
char filename[1024]
input or output filename
static int segment_end(AVFormatContext *oc, int write_trailer)
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...
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
Return in 'buf' the path with 'd' replaced by a number.
static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
char * list
Set by a private option.
enum AVMediaType codec_type
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
int list_type
Set by a private option.
AVOutputFormat ff_segment_muxer
Describe the class of an AVClass context structure.
int avio_open2(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
Create and initialize a AVIOContext for accessing the resource indicated by url.
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
int write_header_trailer
Set by a private option.
static const AVClass seg_class
void * priv_data
Format private data.
static const AVOption options[]
static void write_header(FFV1Context *f)
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
static int open_null_ctx(AVIOContext **ctx)
#define AVERROR_MUXER_NOT_FOUND
Muxer not found.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
This structure stores compressed data.
int avio_closep(AVIOContext **s)
Close the resource accessed by the AVIOContext *s, free it and set the pointer pointing to it to NULL...
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2