作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 requestExportSessionForVideo 方法从 PHAsset 获取可发送视频,但我收到此警告,并且导出 session 记录了一个空值:
Null passed to a callee that requires a non-null argument
[manager requestExportSessionForVideo:asset options:videoOptions exportPreset:AVAssetExportSessionStatusUnknown resultHandler:^(AVAssetExportSession * _Nullable exportSession, NSDictionary * _Nullable info) {
NSLog(@"Export session is: %@ ///// Info is %@", exportSession, info);
}];
Info is {
PHImageFileSandboxExtensionTokenKey = "8b504346993c71de48743d3c9c796385d7911ad2;00000000;00000000;000000000000001b;com.apple.avasset.read-only;00000001;01000002;00000000000468eb;/private/var/mobile/Media/DCIM/100APPLE/IMG_0004.MOV";
PHImageResultDeliveredImageFormatKey = 20000;
PHImageResultIsInCloudKey = 0;
PHImageResultWantedImageFormatKey = 20000;
}
最佳答案
这可能会帮助您进一步进行。我目前面临同样的问题。但以下方法给了我视频网址。
PHVideoRequestOptions* options = [[PHVideoRequestOptions alloc] init];
options.version = PHVideoRequestOptionsVersionOriginal;
options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
options.networkAccessAllowed = YES;
options.progressHandler = ^(double progress,NSError *error,BOOL* stop, NSDictionary* dict) {
NSLog(@"progress %lf",progress); //never gets called
};
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:options resultHandler:^(AVAsset* avasset, AVAudioMix* audioMix, NSDictionary* info){
NSLog(@"##Info:\n%@",info);
AVURLAsset* myAsset = (AVURLAsset*)avasset;
NSLog(@"##AVAsset URL: %@",myAsset.URL);
}];
2015-11-25 12:00:04.482 iLockBox[7602:2587808] ##Info:
{
PHImageFileSandboxExtensionTokenKey = "7c2094f4c69015b87df6d7c86ec3217cc544e2e2;00000000;00000000;000000000000001b;com.apple.avasset.read-only;00000001;01000002;0000000000ff9a15;/private/var/mobile/Media/DCIM/111APPLE/IMG_1087.MOV";
PHImageResultDeliveredImageFormatKey = 20000;
PHImageResultIsInCloudKey = 0;
PHImageResultWantedImageFormatKey = 20000;
}
2015-11-25 12:00:16.007 iLockBox[7602:2587808] ##AVAsset URL: file:///var/mobile/Media/DCIM/111APPLE/IMG_1087.MOV
关于ios - requestExportSessionForVideo 空错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33402017/
我正在使用 requestExportSessionForVideo 方法从 PHAsset 获取可发送视频,但我收到此警告,并且导出 session 记录了一个空值: Null passed to
我是一名优秀的程序员,十分优秀!