问题描述
在我的macOS应用中,我启动ffmpeg任务以检索媒体文件信息。
由于EXC_GUARD,我收到很多崩溃消息:
Exception Type: EXC_GUARD
Exception Codes: 0x4000000200000001,0xd71a2ae8e8dab339
Exception Subtype: GUARD_TYPE_FD,id=0xd71a2ae8e8dab339,fd=1,flavor=0x00000002 (DUP)
这是我使用的代码:
NSArray *ffmpegArgs = [NSArray arrayWithObjects:@"-hide_banner",@"-nostdin",@"-nostats",@"-i",self.media.path,nil];
self.task = [[NSTask alloc] init];
[self.task setLaunchPath:[[NSBundle mainBundle] pathForResource:@"ffmpeg" ofType:nil]];
[self.task setArguments:ffmpegArgs];
NSPipe *errorPipe = [NSPipe pipe];
self.task.standardError = errorPipe;
NSFileHandle *errorHandle = [errorPipe fileHandleForReading];
@try {
[self.task launch];
} @catch (NSException *exception) {
NSLog(@"An exception %@ was thrown while attempting to launch the ffmpeg task with arguments: %@.",exception.description,[ffmpegArgs componentsJoinedByString:@" "]);
[errorHandle closeFile];
return;
}
[self.task waitUntilExit];
NSData *outputData = [errorHandle readDataToEndOfFile];
[errorHandle closeFile];
我无法在设备上重现此崩溃。
有人可以帮助我吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)