一、
muxer(封装器) 和 demuxer(解封装器)存放在 libavformat 目录下的mux.c 文件中;
1、封装器 muxer
muxer 提供的接口有:
int avformat_write_header(AVFormatContext *s, AVDictionary **options) int av_write_frame(AVFormatContext *s, AVPacket *pkt) int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt)
int av_write_trailer(AVFormatContext *s)static int write_packet(AVFormatContext *s, AVPacket *pkt)
从API也可以看出封装器的工作主要就是写数据文件的头和尾以及数据帧
2、封装器实现对应的数据结构是: AVIputFormat
typedef struct AVInputFormat { /** * A comma separated list of short names for the format. New names * may be appended with a minor bump. */ const char *name; /** * Descriptive name for the format, meant to be more human-readable * than name. You should use the NULL_IF_CONFIG_SMALL() macro * to define it. */ const char *long_name; int flags; /** * If extensions are defined, then no probe is done. You should * usually not use extension