【发布时间】:2016-05-11 04:20:19
【问题描述】:
我正在尝试通过本教程学习 FFMpeg:http://dranger.com/ffmpeg/tutorial01.html
我希望只要将 C 代码翻译成 swift 就可以让我启动并运行,但我想我错了
我尝试转换以下代码:
AVFormatContext *pFormatCtx = NULL;
// Open video file
if(avformat_open_input(&pFormatCtx, argv[1], NULL, 0, NULL)!=0) {}
到:
let pFormatCtx : UnsafeMutablePointer<UnsafeMutablePointer<AVFormatContext>> = nil
// Open video file
if avformat_open_input(pFormatCtx, path, nil, opaque) != 0 {}
此代码在以下位置中断:if avformat_open_input(pFormatCtx, path, nil, opaque) != 0 {} 出现 EXC_BAD_ACCESS 错误
谁能猜到这里出了什么问题??
顺便说一句,我的 FFMpeg 库编译没有问题,所以我认为我编译或导入它的方式可能没有问题。我认为我可能传递了错误的论点:/有什么猜测吗??
【问题讨论】: