I am trying to learn FFMpeg in this tutorial: http://dranger.com/ffmpeg/tutorial01.html
I was hoping that just translating the C code to swift, I should run me, but I think I was wrong.
I tried to convert the following code:
AVFormatContext *pFormatCtx = NULL;
if(avformat_open_input(&pFormatCtx, argv[1], NULL, 0, NULL)!=0) {}
in
let pFormatCtx : UnsafeMutablePointer<UnsafeMutablePointer<AVFormatContext>> = nil
if avformat_open_input(pFormatCtx, path, nil, opaque) != 0 {}
This code breaks into: if avformat_open_input (pFormatCtx, path, nil, opaque)! = 0 {} On error EXC_BAD_ACCESS
Can anyone guess what is wrong here?
By the way, my FFMpeg library compiles without problems, so I donโt think there might be a problem with the way I compiled or imported it. Iโm probably mistaken, I think: / Any guesses
source
share