av_find_best_stream

简介: av_find_best_stream

av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0);

-1:要处理的流的索引号,不知道填-1

-1:要处理的流相关流的索引号,比如视频的相关是音频,不知道填-1

NULL:流的编解码器,不关心填NULL

0:flag,不关心填0

返回值:小于0错误,不小于0则是要找的流的索引值。


image.png

相关文章
|
10月前
|
Java
Leetcode 295. Find Median from Data Stream
在一个有序数组中找中位数,但需要支持再数组中添加新的元素。本来是有序里的,可以很轻易就查到中位数,但如果添加新数字后,不一定有序。如果先对数组排序,那代价就比较大了,每次排序时间复杂度O(n*log(n)),看discuss发现了一种很巧妙的解法,可以把添加数据的时间复杂度降低到O(log(n)) ,查询中位数O(1)。
42 0
|
6天前
|
关系型数据库 Unix Shell
File - os.tcsetpgrp(fd, pg)函数
`os.tcsetpgrp(fd, pg)` 函数在进行进程控制和信号管理时非常有用,但它涉及Unix底层的工作原理,因此使用时需具备相应知识,以确保正确和适用,并注意相关的权限和错误处理。
134 61
|
4月前
|
编解码 应用服务中间件 nginx
DemuxException: type = CodecUnsupported, info = Flv: Unsupported codec in video frame: 2
DemuxException: type = CodecUnsupported, info = Flv: Unsupported codec in video frame: 2
330 0
ffmpeg编码报错:more samples than frame size (avcodec_encode_audio2)
ffmpeg编码报错:more samples than frame size (avcodec_encode_audio2)
84 0
ffmpeg编码报错:more samples than frame size (avcodec_encode_audio2)
|
网络协议
av_interleaved_write_frame -32 broken pipe
av_interleaved_write_frame -32 broken pipe
212 0
av_interleaved_write_frame -32 broken pipe
|
编解码
av_read_frame返回值为-5 Input/output error
av_read_frame返回值为-5 Input/output error
139 0
base64转图片的时候Can't read input file!
如果不去掉编码中的图片头信息,就会报Can't read input file!。 一开始还以为是文件路径格式有问题,然后看了看我之前用的,就有一个区别就是没有去头信息。
|
存储 传感器 消息中间件
Stream is the new file
随着5G 网络、容器云、高性能存储硬件水平的不断提高,流处理正在拥有越来越广泛的市场前景。
Stream is the new file