如何在录制视频时接收字节

时间:2014-03-02 12:03:46

标签: ios uiimagepickercontroller

我正在开发iphone视频应用程序,因为我想在用户录制视频本身时获取磁盘占用的字节数。

- (void)imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info;

用户完成挑选后调用此方法。有任何方法

2 个答案:

答案 0 :(得分:0)

UIImage *img = [UIImage imageNamed:@"sample.png"];
 NSData *imgData = UIImageJPEGRepresentation(img, 0); 
 NSLog(@"Size of Image(bytes):%d",[imgData length]);

答案 1 :(得分:-2)

NSData *data = [info objectForKey: UIImagePickerControllerMediaMetadata];