FFMPEG: [ API ] >打开/关闭一个输入文件

它们是成对出现的.

ffmpeg 把输入文件--转换成--->AVFormatContext实例

 

◆ avformat_open_input()

int avformat_open_input(AVFormatContext ** ps,
const char * url,
ff_const59 AVInputFormat * fmt,
AVDictionary ** options 
)

Open an input stream and read the header.

The codecs are not opened. The stream must be closed with avformat_close_input().

Parameters

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.

(输出参数: 返回格式上下文实例)

urlURL of the stream to open.
fmtIf non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected.
optionsA dictionary filled with AVFormatContext and demuxer-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL.

Returns

0 on success, a negative AVERROR on failure.

◆ avformat_close_input()

void avformat_close_input(AVFormatContext ** s)

Close an opened input AVFormatContext.

Free it and all its contents and set *s to NULL.

Examples

avio_reading.cdemuxing_decoding.cfiltering_audio.cfiltering_video.chw_decode.cmetadata.cqsvdec.cremuxing.ctranscode_aac.ctranscoding.c, and vaapi_transcode.c.

Definition at line 4498 of file utils.c.

Referenced by avi_read_close()close_demux_for_component()close_input_file()concat_read_close()concat_seek()ff_load_image()ff_rtsp_close_streams()ff_wms_parse_sdp_a_line()ffmpeg_cleanup()free_playlist_list()free_representation()handle_file()LLVMFuzzerTestOneInput()main()movie_uninit()open_file()open_input_file()rdt_close_context()read_thread()sap_read_close()seek_test()stream_close()video_decode(), and video_decode_example().

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值