avformat.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2001 Fabrice Bellard
3  *
4  * This file is part of Libav.
5  *
6  * Libav is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * Libav is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with Libav; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVFORMAT_AVFORMAT_H
22 #define AVFORMAT_AVFORMAT_H
23 
256 #include <time.h>
257 #include <stdio.h> /* FILE */
258 #include "libavcodec/avcodec.h"
259 #include "libavutil/dict.h"
260 #include "libavutil/log.h"
261 
262 #include "avio.h"
263 #include "libavformat/version.h"
264 
265 struct AVFormatContext;
266 
267 
346 /* packet functions */
347 
348 
358 int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
359 
360 
375 int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
376 
377 /*************************************************/
378 /* input/output formats */
379 
380 struct AVCodecTag;
381 
385 typedef struct AVProbeData {
386  const char *filename;
387  unsigned char *buf;
388  int buf_size;
389  const char *mime_type;
390 } AVProbeData;
391 
392 #define AVPROBE_SCORE_EXTENSION 50
393 #define AVPROBE_SCORE_MIME 75
394 #define AVPROBE_SCORE_MAX 100
395 
396 #define AVPROBE_PADDING_SIZE 32
397 
398 #define AVFMT_NOFILE 0x0001
400 #define AVFMT_NEEDNUMBER 0x0002
401 #define AVFMT_SHOW_IDS 0x0008
402 #if FF_API_LAVF_FMT_RAWPICTURE
403 #define AVFMT_RAWPICTURE 0x0020
405 #endif
406 #define AVFMT_GLOBALHEADER 0x0040
407 #define AVFMT_NOTIMESTAMPS 0x0080
408 #define AVFMT_GENERIC_INDEX 0x0100
409 #define AVFMT_TS_DISCONT 0x0200
410 #define AVFMT_VARIABLE_FPS 0x0400
411 #define AVFMT_NODIMENSIONS 0x0800
412 #define AVFMT_NOSTREAMS 0x1000
413 #define AVFMT_NOBINSEARCH 0x2000
414 #define AVFMT_NOGENSEARCH 0x4000
415 #define AVFMT_NO_BYTE_SEEK 0x8000
416 #define AVFMT_ALLOW_FLUSH 0x10000
417 #define AVFMT_TS_NONSTRICT 0x20000
420 #define AVFMT_TS_NEGATIVE 0x40000
430 typedef struct AVOutputFormat {
431  const char *name;
437  const char *long_name;
438  const char *mime_type;
439  const char *extensions;
440  /* output support */
441  enum AVCodecID audio_codec;
442  enum AVCodecID video_codec;
443  enum AVCodecID subtitle_codec;
450  int flags;
451 
456  const struct AVCodecTag * const *codec_tag;
458 
459  const AVClass *priv_class;
460 
461  /*****************************************************************
462  * No fields below this line are part of the public API. They
463  * may not be used outside of libavformat and can be changed and
464  * removed at will.
465  * New public fields should be added right above.
466  *****************************************************************
467  */
468  struct AVOutputFormat *next;
472  int priv_data_size;
473 
474  int (*write_header)(struct AVFormatContext *);
482  int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
483  int (*write_trailer)(struct AVFormatContext *);
487  int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
488  AVPacket *in, int flush);
495  int (*query_codec)(enum AVCodecID id, int std_compliance);
505 typedef struct AVInputFormat {
510  const char *name;
511 
517  const char *long_name;
518 
524  int flags;
525 
531  const char *extensions;
532 
533  const struct AVCodecTag * const *codec_tag;
534 
535  const AVClass *priv_class;
536 
542  const char *mime_type;
543 
544  /*****************************************************************
545  * No fields below this line are part of the public API. They
546  * may not be used outside of libavformat and can be changed and
547  * removed at will.
548  * New public fields should be added right above.
549  *****************************************************************
550  */
551  struct AVInputFormat *next;
552 
556  int raw_codec_id;
557 
561  int priv_data_size;
562 
569 
575  int (*read_header)(struct AVFormatContext *);
576 
586  int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
587 
592  int (*read_close)(struct AVFormatContext *);
602  int (*read_seek)(struct AVFormatContext *,
603  int stream_index, int64_t timestamp, int flags);
604 
609  int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
610  int64_t *pos, int64_t pos_limit);
611 
616  int (*read_play)(struct AVFormatContext *);
617 
622  int (*read_pause)(struct AVFormatContext *);
630  int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
631 } AVInputFormat;
636 enum AVStreamParseType {
642 };
644 typedef struct AVIndexEntry {
645  int64_t pos;
646  int64_t timestamp;
647 #define AVINDEX_KEYFRAME 0x0001
648  int flags:2;
649  int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
650  int min_distance;
653 #define AV_DISPOSITION_DEFAULT 0x0001
654 #define AV_DISPOSITION_DUB 0x0002
655 #define AV_DISPOSITION_ORIGINAL 0x0004
656 #define AV_DISPOSITION_COMMENT 0x0008
657 #define AV_DISPOSITION_LYRICS 0x0010
658 #define AV_DISPOSITION_KARAOKE 0x0020
659 
665 #define AV_DISPOSITION_FORCED 0x0040
666 #define AV_DISPOSITION_HEARING_IMPAIRED 0x0080
667 #define AV_DISPOSITION_VISUAL_IMPAIRED 0x0100
668 #define AV_DISPOSITION_CLEAN_EFFECTS 0x0200
675 #define AV_DISPOSITION_ATTACHED_PIC 0x0400
676 
677 typedef struct AVStreamInternal AVStreamInternal;
678 
686 typedef struct AVStream {
687  int index;
693  int id;
694 #if FF_API_LAVF_AVCTX
695 
699  AVCodecContext *codec;
700 #endif
701  void *priv_data;
702 
715  AVRational time_base;
716 
723  int64_t start_time;
724 
730  int64_t duration;
731 
732  int64_t nb_frames;
733 
734  int disposition;
736  enum AVDiscard discard;
743  AVRational sample_aspect_ratio;
744 
745  AVDictionary *metadata;
746 
754  AVRational avg_frame_rate;
755 
763  AVPacket attached_pic;
764 
781  AVPacketSideData *side_data;
785  int nb_side_data;
786 
792  int event_flags;
793 #define AVSTREAM_EVENT_FLAG_METADATA_UPDATED 0x0001
794 
795  /*
796  * Codec parameters associated with this stream. Allocated and freed by
797  * libavformat in avformat_new_stream() and avformat_free_context()
798  * respectively.
799  *
800  * - demuxing: filled by libavformat on stream creation or in
801  * avformat_find_stream_info()
802  * - muxing: filled by the caller before avformat_write_header()
803  */
804  AVCodecParameters *codecpar;
805 
806  /*****************************************************************
807  * All fields below this line are not part of the public API. They
808  * may not be used outside of libavformat and can be changed and
809  * removed at will.
810  * New public fields should be added right above.
811  *****************************************************************
812  */
813 
817 #define MAX_STD_TIMEBASES (60*12+5)
818  struct {
819  int nb_decoded_frames;
820  int found_decoder;
821 
825  int64_t fps_first_dts;
826  int fps_first_dts_idx;
827  int64_t fps_last_dts;
828  int fps_last_dts_idx;
829 
830  } *info;
831 
832  int pts_wrap_bits;
834  // Timestamp generation support:
835  int64_t first_dts;
836  int64_t cur_dts;
837  int64_t last_IP_pts;
838  int last_IP_duration;
843 #define MAX_PROBE_PACKETS 2500
844  int probe_packets;
849  int codec_info_nb_frames;
851  /* av_read_frame() support */
852  enum AVStreamParseType need_parsing;
854 
858  struct AVPacketList *last_in_packet_buffer;
859  AVProbeData probe_data;
860 #define MAX_REORDER_DELAY 16
861  int64_t pts_buffer[MAX_REORDER_DELAY+1];
862 
863  AVIndexEntry *index_entries;
865  int nb_index_entries;
866  unsigned int index_entries_allocated_size;
872  AVStreamInternal *internal;
874 
875 #define AV_PROGRAM_RUNNING 1
876 
883 typedef struct AVProgram {
884  int id;
885  int flags;
886  enum AVDiscard discard;
887  unsigned int *stream_index;
888  unsigned int nb_stream_indexes;
889  AVDictionary *metadata;
892 #define AVFMTCTX_NOHEADER 0x0001
895 typedef struct AVChapter {
896  int id;
897  AVRational time_base;
898  int64_t start, end;
899  AVDictionary *metadata;
900 } AVChapter;
901 
902 typedef struct AVFormatInternal AVFormatInternal;
912 typedef struct AVFormatContext {
917  const AVClass *av_class;
918 
924  struct AVInputFormat *iformat;
931  struct AVOutputFormat *oformat;
940  void *priv_data;
941 
954  AVIOContext *pb;
955 
956  /* stream info */
961  int ctx_flags;
968  unsigned int nb_streams;
980  AVStream **streams;
981 
988  char filename[1024];
989 
997  int64_t start_time;
998 
1007  int64_t duration;
1008 
1014  int bit_rate;
1016  unsigned int packet_size;
1017  int max_delay;
1018 
1023  int flags;
1024 #define AVFMT_FLAG_GENPTS 0x0001
1025 #define AVFMT_FLAG_IGNIDX 0x0002
1026 #define AVFMT_FLAG_NONBLOCK 0x0004
1027 #define AVFMT_FLAG_IGNDTS 0x0008
1028 #define AVFMT_FLAG_NOFILLIN 0x0010
1029 #define AVFMT_FLAG_NOPARSE 0x0020
1030 #define AVFMT_FLAG_NOBUFFER 0x0040
1031 #define AVFMT_FLAG_CUSTOM_IO 0x0080
1032 #define AVFMT_FLAG_DISCARD_CORRUPT 0x0100
1033 #define AVFMT_FLAG_FLUSH_PACKETS 0x0200
1040 #define AVFMT_FLAG_BITEXACT 0x0400
1047  unsigned int probesize;
1054  int max_analyze_duration;
1056  const uint8_t *key;
1057  int keylen;
1058 
1059  unsigned int nb_programs;
1060  AVProgram **programs;
1061 
1066  enum AVCodecID video_codec_id;
1072  enum AVCodecID audio_codec_id;
1073 
1078  enum AVCodecID subtitle_codec_id;
1079 
1090  unsigned int max_index_size;
1091 
1096  unsigned int max_picture_buffer;
1097 
1109  unsigned int nb_chapters;
1110  AVChapter **chapters;
1111 
1120  AVDictionary *metadata;
1121 
1128  int64_t start_time_realtime;
1129 
1135  int fps_probe_size;
1142  int error_recognition;
1153  AVIOInterruptCB interrupt_callback;
1154 
1158  int debug;
1159 #define FF_FDEBUG_TS 0x0001
1160 
1177  int64_t max_interleave_delta;
1178 
1183  int strict_std_compliance;
1184 
1190  int event_flags;
1191 #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001
1192 
1193 
1197  int max_ts_probe;
1206  int avoid_negative_ts;
1207 #define AVFMT_AVOID_NEG_TS_AUTO -1
1208 #define AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE 1
1209 #define AVFMT_AVOID_NEG_TS_MAKE_ZERO 2
1210 
1211 
1215  AVFormatInternal *internal;
1220  void *opaque;
1221 
1242  int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url,
1243  int flags, AVDictionary **options);
1244 
1248  void (*io_close)(struct AVFormatContext *s, AVIOContext *pb);
1249 
1257  char *protocol_blacklist;
1258 
1266  char *protocol_whitelist;
1267 } AVFormatContext;
1268 
1269 typedef struct AVPacketList {
1270  AVPacket pkt;
1271  struct AVPacketList *next;
1272 } AVPacketList;
1273 
1287 unsigned avformat_version(void);
1288 
1292 const char *avformat_configuration(void);
1293 
1297 const char *avformat_license(void);
1298 
1308 void av_register_all(void);
1309 
1312 
1321 int avformat_network_init(void);
1322 
1326 int avformat_network_deinit(void);
1327 
1334 
1341 
1348 
1354 
1361 const AVClass *avformat_get_class(void);
1362 
1380 
1394  uint8_t *data, size_t size);
1395 
1404 uint8_t *av_stream_new_side_data(AVStream *stream,
1405  enum AVPacketSideDataType type, int size);
1414 uint8_t *av_stream_get_side_data(AVStream *stream,
1415  enum AVPacketSideDataType type, int *size);
1416 
1418 
1432 AVInputFormat *av_find_input_format(const char *short_name);
1433 
1441 AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
1442 
1455 AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
1456 
1473  const char *filename, void *logctx,
1474  unsigned int offset, unsigned int max_probe_size);
1475 
1495 int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
1496 
1519 
1545  enum AVMediaType type,
1546  int wanted_stream_nb,
1547  int related_stream,
1548  AVCodec **decoder_ret,
1549  int flags);
1550 
1576 
1590 int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
1591  int flags);
1592 
1620 int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
1621 
1627 
1634 
1644 #define AVSEEK_FLAG_BACKWARD 1
1645 #define AVSEEK_FLAG_BYTE 2
1646 #define AVSEEK_FLAG_ANY 4
1647 #define AVSEEK_FLAG_FRAME 8
1648 
1649 
1669 
1708 
1753 
1764 
1777 AVOutputFormat *av_guess_format(const char *short_name,
1778  const char *filename,
1779  const char *mime_type);
1780 
1784 enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
1785  const char *filename, const char *mime_type,
1786  enum AVMediaType type);
1787 
1811 void av_hex_dump(FILE *f, const uint8_t *buf, int size);
1812 
1825 void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
1826 
1835 void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
1836 
1837 
1849 void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
1850  AVStream *st);
1851 
1860 enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
1861 
1870 unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
1871 
1873 
1885 int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
1886 
1893 int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
1894  int size, int distance, int flags);
1895 
1896 
1916 void av_url_split(char *proto, int proto_size,
1917  char *authorization, int authorization_size,
1918  char *hostname, int hostname_size,
1919  int *port_ptr,
1920  char *path, int path_size,
1921  const char *url);
1922 
1923 
1935  int index,
1936  const char *url,
1937  int is_output);
1938 
1951 int av_get_frame_filename(char *buf, int buf_size,
1952  const char *path, int number);
1953 
1960 int av_filename_number_test(const char *filename);
1961 
1979 int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
1980 
1988 int av_match_ext(const char *filename, const char *extensions);
1989 
2000 int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
2001  int std_compliance);
2002 
2018 const struct AVCodecTag *avformat_get_riff_video_tags(void);
2022 const struct AVCodecTag *avformat_get_riff_audio_tags(void);
2031 #endif /* AVFORMAT_AVFORMAT_H */
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
full parsing and interpolation of timestamps for frames not starting on a packet boundary ...
Definition: avformat.h:647
Bytestream IO Context.
Definition: avio.h:111
Buffered I/O operations.
AVPacketSideDataType
Definition: avcodec.h:987
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
Write a packet to an output media file ensuring correct interleaving.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
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.
const char * filename
Definition: avformat.h:386
int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)
Open an input stream and read the header.
void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st)
Send a nice dump of a packet to the specified file stream.
uint8_t * av_stream_get_side_data(AVStream *stream, enum AVPacketSideDataType type, int *size)
Get side information from stream.
int priv_data_size
Size of private data so that it can be allocated in the wrapper.
Definition: avformat.h:568
AVCodec.
Definition: avcodec.h:2842
This struct describes the properties of an encoded stream.
Definition: avcodec.h:3265
Format I/O context.
Definition: avformat.h:920
Public dictionary API.
int flags
can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE
Definition: avformat.h:457
const struct AVCodecTag * avformat_get_riff_video_tags(void)
enum AVCodecID av_codec_get_id(const struct AVCodecTag *const *tags, unsigned int tag)
Get the AVCodecID for the given codec tag tag.
unsigned avformat_version(void)
Return the LIBAVFORMAT_VERSION_INT constant.
const char * avformat_license(void)
Return the libavformat license.
AVPacket pkt
Definition: avformat.h:1278
struct AVFormatInternal AVFormatInternal
Definition: avformat.h:910
int priv_data_size
size of private data so that it can be allocated in the wrapper
Definition: avformat.h:479
struct AVStreamInternal AVStreamInternal
Definition: avformat.h:684
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVFormatContext * avformat_alloc_context(void)
Allocate an AVFormatContext.
const char * avformat_configuration(void)
Return the libavformat build-time configuration.
#define MAX_REORDER_DELAY
Definition: avformat.h:867
int flags
Flags modifying the (de)muxer behaviour.
Definition: avformat.h:1031
AVProgram * av_new_program(AVFormatContext *s, int id)
char * protocol_whitelist
A comma-separated list of protocol names that can be used internally by libavformat.
Definition: avformat.h:1274
int avformat_network_init(void)
Do global initialization of network components.
const struct AVCodecTag * avformat_get_riff_audio_tags(void)
int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
Generate an SDP for an RTP session.
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
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.
const AVClass * avformat_get_class(void)
Get the AVClass for AVFormatContext.
int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
Read data and append it to the current content of the AVPacket.
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)
Print detailed information about the input or output format, such as duration, bitrate, streams, container, programs, metadata, side data, codec and time base.
Callback for checking whether to abort blocking functions.
Definition: avio.h:58
int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, AVCodec **decoder_ret, int flags)
Find the "best" stream in the file.
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:211
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
void av_hex_dump(FILE *f, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the specified file stream.
struct AVCodecParser * parser
Definition: avcodec.h:4246
struct AVDictionary AVDictionary
Definition: dict.h:77
int av_read_play(AVFormatContext *s)
Start playing a network-based stream (e.g.
New fields can be added to the end with minor version bumps.
Definition: avformat.h:890
AVInputFormat * av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)
Guess the file format.
Only parse headers, do not repack.
Definition: avformat.h:646
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
Test if the given container can store a codec.
const char * mime_type
mime_type, when known.
Definition: avformat.h:389
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:388
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:387
int av_read_pause(AVFormatContext *s)
Pause a network-based stream (e.g.
AVInputFormat * av_find_input_format(const char *short_name)
Find AVInputFormat based on the short name of the input format.
int(* write_header)(struct AVFormatContext *)
Definition: avformat.h:481
int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as stream side data.
enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type)
Guess the codec ID based upon muxer and filename.
int av_find_default_stream_index(AVFormatContext *s)
int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)
Probe a bytestream to determine the input format.
uint8_t * av_stream_new_side_data(AVStream *stream, enum AVPacketSideDataType type, int size)
Allocate new information from stream.
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...
void av_register_input_format(AVInputFormat *format)
Libavformat version macros.
AVOutputFormat * av_oformat_next(const AVOutputFormat *f)
If f is NULL, returns the first registered output format, if f is non-NULL, returns the next register...
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
Return in &#39;buf&#39; the path with &#39;d&#39; replaced by a number.
Stream structure.
Definition: avformat.h:693
void av_register_output_format(AVOutputFormat *format)
int avformat_network_deinit(void)
Undo the initialization done by avformat_network_init.
Libavcodec external API header.
struct AVOutputFormat * next
Definition: avformat.h:475
AVIOContext * pb
I/O context.
Definition: avformat.h:962
main external API structure.
Definition: avcodec.h:1216
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
void(* io_close)(struct AVFormatContext *s, AVIOContext *pb)
A callback for closing the streams opened with AVFormatContext.io_open().
Definition: avformat.h:1256
Describe the class of an AVClass context structure.
Definition: log.h:34
rational number numerator/denominator
Definition: rational.h:43
AVMediaType
Definition: avutil.h:198
void avformat_free_context(AVFormatContext *s)
Free an AVFormatContext and all its streams.
This structure contains the data a format has to probe a file.
Definition: avformat.h:385
int av_read_frame(AVFormatContext *s, AVPacket *pkt)
Return the next frame of a stream.
int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
Seek to timestamp ts.
full parsing and repack of the first frame only, only implemented for H.264 currently ...
Definition: avformat.h:648
int raw_codec_id
Raw demuxers store their codec ID here.
Definition: avformat.h:563
#define attribute_deprecated
Definition: attributes.h:80
int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Seek to the keyframe at timestamp.
full parsing and repack
Definition: avformat.h:645
struct AVPacketList * next
Definition: avformat.h:1279
int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
Read packets of a media file to get stream information.
AVStreamParseType
Definition: avformat.h:643
void avformat_close_input(AVFormatContext **s)
Close an opened input AVFormatContext.
int(* read_header)(struct AVFormatContext *)
Read the format header and initialize the AVFormatContext structure.
Definition: avformat.h:582
AVDiscard
Definition: avcodec.h:666
int av_write_trailer(AVFormatContext *s)
Write the stream trailer to an output media file and free the file private data.
char * protocol_blacklist
A comma-separated list of protocol names that will not be used internally by libavformat.
Definition: avformat.h:1265
int(* read_probe)(AVProbeData *)
Tell if a given file has a chance of being parsed as this format.
Definition: avformat.h:575
void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, AVStream *st)
Send a nice dump of a packet to the log.
void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size)
Send a nice hexadecimal dump of a buffer to the log.
struct AVInputFormat * next
Definition: avformat.h:558
unsigned int av_codec_get_tag(const struct AVCodecTag *const *tags, enum AVCodecID id)
Get the codec tag for the given codec id id.
AVInputFormat * av_probe_input_format(AVProbeData *pd, int is_opened)
Guess the file format.
This structure stores compressed data.
Definition: avcodec.h:1130
void av_register_all(void)
Initialize libavformat and register all the muxers, demuxers and protocols.
AVInputFormat * av_iformat_next(const AVInputFormat *f)
If f is NULL, returns the first registered input format, if f is non-NULL, returns the next registere...