error: too few arguments to function ‘avformat_find_stream_info’ 34 | if(avformat_find_stream_info(pFormatCtx)<0)
时间: 2023-08-12 10:08:04 浏览: 52
`avformat_find_stream_info` 函数需要一个参数:包含解码器上下文和其他信息的 `AVFormatContext` 结构体指针。错误信息提示说你的调用缺少了参数,因此需要检查一下你的代码是否正确传递了 `AVFormatContext` 指针作为参数。
如果你确定已经传递了正确的参数,那么可能是你的 FFmpeg 版本不同导致的问题。在某些版本的 FFmpeg 中,`avformat_find_stream_info` 函数需要额外的参数,例如:
```
if(avformat_find_stream_info(pFormatCtx, NULL) < 0)
```
在这种情况下,你需要根据你使用的 FFmpeg 版本确定正确的函数调用方式。
相关问题
error: too few arguments to function call, expected 2, have 1 if(avformat_find_stream_info(pFormatCtx)<0)
这个错误提示意味着您调用了 `avformat_find_stream_info` 函数时传递的参数数量不正确。根据函数签名,这个函数需要两个参数,分别是 `AVFormatContext` 和 `AVDictionary` 类型的指针。例如:
```
AVFormatContext *pFormatCtx = avformat_alloc_context();
AVDictionary *options = NULL;
if(avformat_find_stream_info(pFormatCtx, &options)<0) {
// 处理错误
}
```
请注意,`AVDictionary` 参数是可选的,如果您不需要传递任何选项,则可以将其设置为 `NULL`。如果您已经传递了两个正确的参数,但是仍然收到了这个错误提示,请检查您的代码是否正确引入了 FFmpeg 库并是否正确链接了库文件。
error: too few arguments to function 'esp_intr_disable'
抱歉,我的回答可能不太准确。在 ESP-IDF 4.4.4 中,要关闭全局中断并保存当前中断状态,可以使用以下代码:
```
portMUX_TYPE mux = portMUX_INITIALIZER_UNLOCKED;
portMUX_LOCK(&mux);
int state = esp_intr_get_cpu()->state;
esp_intr_disable();
```
这将禁用所有全局中断并保存当前中断状态。在代码执行期间,应该避免使用任何需要全局中断的函数。
如果需要重新启用全局中断并恢复先前的中断状态,可以使用以下代码:
```
esp_intr_enable();
portMUX_UNLOCK(&mux);
```
其中 `mux` 是一个用于保护中断状态的互斥锁,`state` 是保存的中断状态。