gpt4 book ai didi

android - ffmpeg avio_open() 无法打开用于写入编码流的输出文件

转载 作者:太空宇宙 更新时间:2023-11-03 13:33:41 25 4
gpt4 key购买 nike

我正在尝试使用为 android 移植的 ffmpeg 将原始 PCM 转换为 mp4。我面临一个问题,其中 avio_open 返回负值说无法打开 sample.mp4,这是保存在 sdcard 中的输出文件。我已经给出了文件路径像/sdcard/sample.mp4 。

avio_open(&oc->pb, filename, AVIO_FLAG_WRITE)  returns -2

/* 如果需要,打开输出文件 */

 if (!(fmt->flags & AVFMT_NOFILE)) {
if (avio_open(&oc->pb, filename, AVIO_FLAG_WRITE) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
return 1;
}
}

有什么想法吗?

最佳答案

我遇到了同样的问题,但我的情况是启用了编解码器和多路复用器。通过启用文件协议(protocol) --enable-protocol=file 解决了我的问题。

关于android - ffmpeg avio_open() 无法打开用于写入编码流的输出文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10094489/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com