gpt4 book ai didi

ios - requestExportSessionForVideo 空错误

转载 作者:行者123 更新时间:2023-12-01 17:29:39 26 4
gpt4 key购买 nike

我正在使用 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;
}

如何从 PHAsset 中获取可以发送到云容器的视频对象?
这个警告会影响输出吗?
请注意,我的 Assets 是使用 GMImagePicker 选择的。

最佳答案

这可能会帮助您进一步进行。我目前面临同样的问题。但以下方法给了我视频网址。

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com