UIImagePickerControllerを使用した圧縮を避けることはできないようです。私はimagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
を使用して試してみたが、それはまだ圧縮を行い
https://stackoverflow.com/a/5893066/406152
:この回答を参照してください。ああ。
編集:
ただし、自分でロールすることはできます。これは、生のビデオファイルへのアクセスを許可します:
のiOS 8
PHFetchResult *assetsFetchResult = [PHAsset fetchAssetsWithMediaType:PHAssetMediaTypeVideo options:nil];
for (PHAsset *asset in assetsFetchResult) {
PHVideoRequestOptions *videoRequestOptions = [[PHVideoRequestOptions alloc] init];
videoRequestOptions.version = PHVideoRequestOptionsVersionOriginal;
[[PHImageManager defaultManager] requestAVAssetForVideo:asset options:videoRequestOptions resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
// the AVAsset object represents the original video file
}];
}
コレクション(瞬間)および他のオプションにアクセスするためのPhotoKitのドキュメントを見てください。ここで
写真ピッカーように修正することができPhotoKitを使用して、アップルからのサンプルアプリです:それはのためにあなたにPHAsset
オブジェクトを提供しますので、ここでhttps://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html
は有望に見えるPhotoKitを使用していますGitHubの上のフォトピッカーライブラリです選択されたすべての画像/動画:https://github.com/guillermomuntaner/GMImagePicker
のiOS 7と実際
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
if (group) {
// If you want, you can filter just pictures or videos
// I just need videos so I do this:
[group setAssetsFilter:[ALAssetsFilter allVideos]];
[group enumerateAssetsUsingBlock:^(ALAsset *asset, NSUInteger index, BOOL *stop){
if (asset){
// You can now add this ALAsset in your own video picker.
// Note that you can only access the ALAsset as long as
// you maintain a reference to the ALAssetsLibrary
// Or if you want to process the video, you can create an AVAsset:
NSURL *url = asset.defaultRepresentation.url;
AVAsset *videoAsset = [AVAsset assetWithURL:url];
}
}];
}
} failureBlock:^(NSError *error) {
NSLog(@"error enumerating AssetLibrary groups %@\n", error);
}];