我在这个库的帮助下使用ffmpeg实现了IP Camera流:https://github.com/kolyvan/kxmovie我也正在录制IPCamera流式传输,同样是使用ffmpeg完成的.
现在,当我在项目中添加R5ProStreaming.framework并在实际设备应用程序中运行应用程序时,我正面临着一个问题if (avformat_find_stream_info(formatCtx, NULL) < 0).当我删除该框架并将其移至垃圾箱并再次运行时,所有工作正常.
- (kxMovieError) openInput: (NSString *) path
{
AVFormatContext *formatCtx = NULL;
if (_interruptCallback) {
formatCtx = avformat_alloc_context();
if (!formatCtx)
return kxMovieErrorOpenFile;
AVIOInterruptCB cb = {interrupt_callback, (__bridge void *)(self)};
formatCtx->interrupt_callback = cb;
}
AVDictionary *opts = 0;
//
av_dict_set(&opts, "rtsp_transport", "tcp", 0);
if (avformat_open_input(&formatCtx, [path cStringUsingEncoding: NSUTF8StringEncoding], NULL, &opts) < 0) {
av_log(NULL, AV_LOG_ERROR, "Couldn't open file\n");
return kxMovieErrorStreamInfoNotFound;
}
if (avformat_open_input(&formatCtx, [path cStringUsingEncoding: NSUTF8StringEncoding], NULL, NULL) < …Run Code Online (Sandbox Code Playgroud)