49 #define LINE_BUFFER_SIZE 1024
50 #define HLS_MICROSECOND_UNIT 1000000
157 return (
int)((val - (
int)val) >= 0.001) ? (
int)(val + 1) : (
int)val;
166 if (!path || !temp) {
170 if (!strncmp(temp,
"/", 1) || !strncmp(temp,
"\\", 1)) {
172 }
else if (!strncmp(temp,
"./", 2) || !strncmp(temp,
".\\", 2)) {
176 for ( ; *pos !=
'\0'; ++pos) {
177 if (*pos ==
'/' || *pos ==
'\\') {
180 ret = mkdir(temp, 0755);
185 if ((*(pos - 1) !=
'/') || (*(pos - 1) !=
'\\')) {
186 ret = mkdir(temp, 0755);
196 char *q, buf1[20],
c;
197 int nd,
len, addchar_count;
206 if (c ==
'%' && *(p+1) ==
'%')
208 else if (c ==
'%' && (
av_isdigit(*(p+1)) || *(p+1) == placeholder)) {
212 nd = nd * 10 + *(p + addchar_count) -
'0';
216 if (*(p + addchar_count) == placeholder) {
217 len =
snprintf(buf1,
sizeof(buf1),
"%0*"PRId64, (number < 0) ? nd : nd++, number);
220 if ((q - buf + len) > buf_size - 1)
222 memcpy(q, buf1, len);
224 p += (addchar_count + 1);
232 while (addchar_count--)
233 if ((q - buf) < buf_size - 1)
248 float playlist_duration = 0.0f;
249 int ret = 0, path_size, sub_path_size;
250 char *dirname =
NULL, *p, *sub_path;
254 const char *proto =
NULL;
258 playlist_duration += segment->
duration;
259 segment = segment->
next;
264 playlist_duration -= segment->
duration;
265 previous_segment = segment;
266 segment = previous_segment->
next;
267 if (playlist_duration <= -previous_segment->
duration) {
310 }
else if (unlink(path) < 0) {
312 path, strerror(errno));
316 sub_path_size = strlen(segment->
sub_filename) + 1 + (dirname ? strlen(dirname) : 0);
333 }
else if (unlink(sub_path) < 0) {
335 sub_path, strerror(errno));
340 previous_segment = segment;
341 segment = previous_segment->
next;
393 if (ret !=
sizeof(key)) {
468 segment = segment->
next;
474 int64_t pos, int64_t
size)
486 filename,
's', pos + size) < 1) {
488 "Invalid second level segment filename template '%s', "
489 "you can try to remove second_level_segment_size flag\n",
506 "Invalid second level segment filename template '%s', "
507 "you can try to remove second_level_segment_time flag\n",
525 "second_level_segment_duration hls_flag requires use_localtime to be true\n");
530 "second_level_segment_size hls_flag requires use_localtime to be true\n");
535 "second_level_segment_index hls_flag requires use_localtime to be true\n");
545 int segment_renaming_ok = proto && !strcmp(proto,
"file");
550 "second_level_segment_duration hls_flag works only with file protocol segment names\n");
555 "second_level_segment_size hls_flag works only with file protocol segment names\n");
582 "you can try to remove second_level_segment_index flag\n",
598 "you can try to remove second_level_segment_size flag\n",
611 "you can try to remove second_level_segment_time flag\n",
624 int64_t pos, int64_t
size)
627 const char *filename;
712 int ret = 0, is_segment = 0;
713 int64_t new_start_pos;
723 if (strcmp(line,
"#EXTM3U")) {
731 if (
av_strstart(line,
"#EXT-X-MEDIA-SEQUENCE:", &ptr)) {
732 int64_t tmp_sequence = strtoll(ptr,
NULL, 10);
733 if (tmp_sequence < hls->sequence)
735 "Found playlist sequence number was smaller """
736 "than specified start sequence number: %"PRId64
" < %"PRId64
", "
739 av_log(hls,
AV_LOG_DEBUG,
"Found playlist sequence number: %"PRId64
"\n", tmp_sequence);
742 }
else if (
av_strstart(line,
"#EXT-X-DISCONTINUITY", &ptr)) {
750 }
else if (line[0]) {
787 }
else if (http_base_proto) {
794 int target_duration, int64_t sequence)
801 avio_printf(out,
"#EXT-X-TARGETDURATION:%d\n", target_duration);
802 avio_printf(out,
"#EXT-X-MEDIA-SEQUENCE:%"PRId64
"\n", sequence);
809 char final_filename[
sizeof(oc->
filename)];
812 final_filename[len-4] =
'\0';
821 int target_duration = 0;
825 char temp_filename[1024];
829 int use_rename = proto && !strcmp(proto,
"file");
830 static unsigned warned_non_file;
831 char *key_uri =
NULL;
832 char *iv_string =
NULL;
837 if (byterange_mode) {
842 if (!use_rename && !warned_non_file++)
843 av_log(s,
AV_LOG_ERROR,
"Cannot use rename on non file protocol, this may lead to races and temporary partial files\n");
846 snprintf(temp_filename,
sizeof(temp_filename), use_rename ?
"%s.tmp" :
"%s", s->
filename);
851 if (target_duration <= en->duration)
887 avio_printf(out,
"#EXT-X-BYTERANGE:%"PRIi64
"@%"PRIi64
"\n",
890 time_t tt, wrongsecs;
892 struct tm *tm, tmpbuf;
893 char buf0[128], buf1[128];
894 tt = (int64_t)prog_date_time;
895 milli = av_clip(
lrint(1000*(prog_date_time - tt)), 0, 999);
897 strftime(buf0,
sizeof(buf0),
"%Y-%m-%dT%H:%M:%S", tm);
898 if (!strftime(buf1,
sizeof(buf1),
"%z", tm) || buf1[1]<
'0' ||buf1[1]>
'2') {
899 int tz_min, dst = tm->tm_isdst;
902 wrongsecs = mktime(tm);
903 tz_min = (abs(wrongsecs - tt) + 30) / 60;
906 wrongsecs <= tt ?
'+' :
'-',
910 avio_printf(out,
"#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, milli, buf1);
929 avio_printf(sub_out,
"#EXT-X-BYTERANGE:%"PRIi64
"@%"PRIi64
"\n",
945 if (ret >= 0 && use_rename)
956 char *filename, iv_string[
KEYSIZE*2 + 1];
972 av_log(oc,
AV_LOG_ERROR,
"Invalid segment filename template '%s', you can try to use -use_localtime 1 with it\n", c->
basename);
978 struct tm *tm, tmpbuf;
998 if (
mkdir_p(dir) == -1 && errno != EEXIST) {
999 av_log(oc,
AV_LOG_ERROR,
"Could not create directory %s with use_localtime_mkdir\n", dir);
1011 av_log(oc,
AV_LOG_ERROR,
"Invalid segment filename template '%s' you can try to use -use_localtime 1 with it\n", c->
basename);
1043 if ((err =
av_dict_set(&options,
"encryption_iv", iv_string, 0)) < 0)
1070 snprintf(period,
sizeof(period),
"%d", (INT_MAX / 2) - 1);
1093 time_t t = time(
NULL);
1094 struct tm *p, tmbuf;
1098 return (HAVE_LIBC_MSVCRT || !strftime(b,
sizeof(b),
"%s", p) || !strcmp(b,
"%s")) ?
"-%Y%m%d%H%M%S.ts" :
"-%s.ts";
1106 const char *pattern =
"%d.ts";
1108 const char *vtt_pattern =
"%d.vtt";
1111 int vtt_basename_size;
1115 time_t t = time(
NULL);
1120 struct tm *p, tmbuf;
1123 if (!strftime(b,
sizeof(b),
"%Y%m%d%H%M%S", p))
1158 "More than a single video stream present, "
1159 "expect issues decoding it.\n");
1187 basename_size = strlen(s->
filename) + strlen(pattern_localtime_fmt) + 1;
1189 basename_size = strlen(s->
filename) + strlen(pattern) + 1;
1222 vtt_pattern =
".vtt";
1223 vtt_basename_size = strlen(s->
filename) + strlen(vtt_pattern) + 1;
1256 " hls_init_time value will have no effect\n");
1281 "(%"PRId64
" > %"PRId64
"), the result maybe not be what you want.",
1319 int ret, can_split = 1;
1320 int stream_index = 0;
1327 end_pts = init_list_dur + after_init_list_dur ;
1348 is_ref_pkt = can_split = 0;
1360 av_log(s,
AV_LOG_WARNING,
"pkt->duration = 0, maybe the hls segment duration will not precise\n");
1368 int64_t new_start_pos;
1372 if (!old_filename) {
1381 if (!byterange_mode) {
1445 if (!old_filename) {
1489 #define OFFSET(x) offsetof(HLSContext, x)
1490 #define E AV_OPT_FLAG_ENCODING_PARAM
1494 {
"hls_init_time",
"set segment length in seconds at init list",
OFFSET(init_time),
AV_OPT_TYPE_FLOAT, {.dbl = 0}, 0, FLT_MAX,
E},
1495 {
"hls_list_size",
"set maximum number of playlist entries",
OFFSET(max_nb_segments),
AV_OPT_TYPE_INT, {.i64 = 5}, 0, INT_MAX,
E},
1496 {
"hls_ts_options",
"set hls mpegts list of options for the container format used for hls",
OFFSET(format_options_str),
AV_OPT_TYPE_STRING, {.str =
NULL}, 0, 0,
E},
1497 {
"hls_vtt_options",
"set hls vtt list of options for the container format used for hls",
OFFSET(vtt_format_options_str),
AV_OPT_TYPE_STRING, {.str =
NULL}, 0, 0,
E},
1499 {
"hls_wrap",
"set number after which the index wraps (will be deprecated)",
OFFSET(
wrap),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX,
E},
1501 {
"hls_allow_cache",
"explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments",
OFFSET(allowcache),
AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX,
E},
1504 {
"hls_segment_size",
"maximum size per segment file, (in bytes)",
OFFSET(max_seg_size),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX,
E},
1507 {
"hls_flags",
"set flags affecting HLS playlist and media file generation",
OFFSET(
flags),
AV_OPT_TYPE_FLAGS, {.i64 = 0 }, 0, UINT_MAX,
E,
"flags"},
1520 {
"use_localtime",
"set filename expansion with strftime at segment creation",
OFFSET(use_localtime),
AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1,
E },
1521 {
"use_localtime_mkdir",
"create last directory component in strftime-generated filename",
OFFSET(use_localtime_mkdir),
AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1,
E },
1544 .extensions =
"m3u8",
1553 .priv_class = &hls_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
static void write_m3u8_head_block(HLSContext *hls, AVIOContext *out, int version, int target_duration, int64_t sequence)
const char const char void * val
char key_uri[LINE_BUFFER_SIZE+1]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static av_const int av_isdigit(int c)
Locale-independent conversion of ASCII isdigit.
AVIOInterruptCB interrupt_callback
Custom interrupt callbacks for the I/O layer.
static int hls_write_trailer(struct AVFormatContext *s)
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
static int replace_int_data_in_filename(char *buf, int buf_size, const char *filename, char placeholder, int64_t number)
char * vtt_format_options_str
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int use_localtime_mkdir
flag to mkdir dirname in timebased filename
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
static int mkdir_p(const char *path)
#define AVIO_FLAG_READ
read-only
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
#define AVIO_FLAG_WRITE
write-only
int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
Copy entries from one AVDictionary struct into another.
static int 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...
const char * av_basename(const char *path)
Thread safe basename.
static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, double duration, int64_t pos, int64_t size)
miscellaneous OS support macros and functions.
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
static void hls_free_segments(HLSSegment *p)
HLSSegment * old_segments
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.
char * protocol_whitelist
',' separated list of allowed protocols.
#define AVERROR_EOF
End of file.
char * format_options_str
#define AV_LOG_VERBOSE
Detailed information.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int sls_flags_filename_process(struct AVFormatContext *s, HLSContext *hls, HLSSegment *en, double duration, int64_t pos, int64_t size)
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
struct AVOutputFormat * oformat
The output container format.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
static const AVOption options[]
double initial_prog_date_time
static int hls_write_header(AVFormatContext *s)
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.
#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.
static const char * get_default_pattern_localtime_fmt(void)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values. ...
enum AVMediaType codec_type
General type of the encoded data.
AVDictionary * vtt_format_options
simple assert() macros that are a bit more flexible than ISO C assert().
static av_always_inline av_const double round(double x)
char key_uri[LINE_BUFFER_SIZE+1]
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
static struct tm * gmtime_r(const time_t *clock, struct tm *result)
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.
static int get_int_from_double(double val)
static void set_http_options(AVFormatContext *s, AVDictionary **options, HLSContext *c)
char * av_asprintf(const char *fmt,...)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
static int sls_flag_check_duration_size_index(HLSContext *hls)
char key_string[KEYSIZE *2+1]
#define HLS_MICROSECOND_UNIT
char filename[1024]
input or output filename
#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.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
static struct tm * localtime_r(const time_t *clock, struct tm *result)
static int write_trailer(AVFormatContext *s1)
static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
HLSSegment * last_segment
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...
AVDictionary * format_options
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
static void sls_flag_file_rename(HLSContext *hls, char *old_filename)
int use_localtime
flag to expand filename with localtime
int av_dict_parse_string(AVDictionary **pm, const char *str, const char *key_val_sep, const char *pairs_sep, int flags)
Parse the key/value pairs list and add the parsed entries to a dictionary.
char iv_string[KEYSIZE *2+1]
char * av_strdup(const char *s)
Duplicate a string.
static int sls_flag_use_localtime_filename(AVFormatContext *oc, HLSContext *c)
#define AV_TIME_BASE_Q
Internal time base represented as fractional value.
AVIOContext * pb
I/O context.
static int hls_encryption_start(AVFormatContext *s)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> in
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Describe the class of an AVClass context structure.
static void hls_rename_temp_file(AVFormatContext *s, AVFormatContext *oc)
char iv_string[KEYSIZE *2+1]
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist)
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
const char * avio_find_protocol_name(const char *url)
Return the name of the protocol that will handle the passed URL.
char key_file[LINE_BUFFER_SIZE+1]
static int hls_mux_init(AVFormatContext *s)
static HLSSegment * find_segment_by_filename(HLSSegment *segment, const char *filename)
char current_segment_final_filename_fmt[1024]
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
const char * av_dirname(char *path)
Thread safe dirname.
static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls)
int pts_wrap_bits
number of bits in pts (used for wrapping control)
static int parse_playlist(AVFormatContext *s, const char *url)
uint32_t start_sequence_source_type
static int hls_start(AVFormatContext *s)
void * priv_data
Format private data.
static const uint8_t start_sequence[]
static void write_header(FFV1Context *f)
AVOutputFormat ff_hls_muxer
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
char * protocol_blacklist
',' separated list of disallowed protocols.
#define AVERROR_MUXER_NOT_FOUND
Muxer not found.
AVCodecParameters * codecpar
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
AVOutputFormat * vtt_oformat
static int sls_flag_check_duration_size(HLSContext *hls)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
static const AVClass hls_class
int(* io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
This structure stores compressed data.
int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
void(* io_close)(struct AVFormatContext *s, AVIOContext *pb)
A callback for closing the streams opened with AVFormatContext.io_open().
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.
int avio_printf(AVIOContext *s, const char *fmt,...) av_printf_format(2
AVFormatContext * vtt_avf