ffmpeg学习之路(一)Demux过程(解复用)1

本文深入探讨ffmpeg中的Demux过程,重点解析关键函数avformat_open_input。该函数在avformat.h头文件中定义,负责媒体文件的解复用。通过分析,当函数执行成功,会填充AVFormatContext结构,否则将释放内存。文章还提及了函数参数的作用,如媒体文件名、指定格式和额外选项,并预告后续会介绍重要数据结构AVFormatContext。
摘要由CSDN通过智能技术生成

上一篇文章说了一下媒体文件解码的流程,在该基础上再对其中的第一个过程Demux在ffmpeg中是如何实现的进行说明。

ffmpeg中用来进行Demux的关键函数是avformat_open_input,这里先贴一下源码中的定义:

头文件:avformat.h

<span style="font-size:18px;"><span style="font-size:18px;">/**
 * Open an input stream and read the header. The codecs are not opened.
 * The stream must be closed with av_close_input_file().
 *
 * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
 *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
 *           function and written into ps.
 *           Note that a user-supplied AVFormatContext will be freed on failure.
 * @param filename Name of the stream to
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值