ffmpeg 基本数据结构和对象(二): muxer/demuxer 和 encoder/decoder

本文介绍了FFmpeg库中的muxer(封装器)和demuxer(解封装器),主要存在于libavformat/mux.c文件中。封装器负责将编码后的数据写入特定格式的文件,而解封装器则负责从这些文件中读取原始流。
摘要由CSDN通过智能技术生成

一、

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)

static int write_packet(AVFormatContext *s, AVPacket *pkt)
int av_write_trailer(AVFormatContext *s)



从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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值