चूंकि UIImagePickerController का उपयोग करके संपीड़न से बचने के लिए अभी तक कोई रास्ता नहीं है, इसलिए मैं कुछ विचारों को शामिल करना चाहता हूं कि आप अपना खुद का छवि पिकर कैसे बना सकते हैं जो संपीड़न से बचें।
आईओएस संग्रह (क्षणों) और अन्य विकल्पों तक पहुँचने के लिए PhotoKit प्रलेखन पर 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
}];
}
देखो:
यह कच्चे वीडियो फ़ाइलों के लिए उपयोग की अनुमति देगा। https://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html
यहाँ PhotoKit कि होनहार लग रहा है, क्योंकि यह आप के लिए PHAsset वस्तुओं देता है का उपयोग करता है GitHub पर एक फ़ोटो पिकर पुस्तकालय है:
यहां नमूने PhotoKit का उपयोग कर कि एक फ़ोटो पिकर होने के लिए संशोधित किया जा सकता है एप्पल से अनुप्रयोग है सभी चयनित छवियों/वीडियो: 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);
}];
अभी भी इस के लिए एक समाधान नहीं मिला है। क्या किसी के भी पास कोई सुझाव है? – Avalanchis
नीचे दिए गए मेरे उत्तरों पर एक नज़र डालें।ऐसा लगता है कि डेवलपर्स संपीड़न को प्रभावित कर सकते हैं। – memmons
Avalanchis - यह 2 साल पहले उत्तर दिया गया था। स्वीकार करने के लिए संभव है? – memmons