如何在 iPhone 中存储捕获视频的时间段(持续时间)?
感谢大家对我发布的问题的答复。
我遇到一个问题,在 iPhone 中捕获视频时,我不知道如何存储用 iPhone 捕获视频的时间段(持续时间)。任何人都可以解决我的问题吗?
我正在使用以下代码进行捕获。
-(void) RecordVideoWithCamera
{
printf("\n Hai I am in record vedio with camera -============");
[self startCameraPickerFromViewController:self usingDelegate:self];
}
- (BOOL)startCameraPickerFromViewController:(UIViewController*)controller usingDelegate:(id<UIImagePickerControllerDelegate>)delegateObject
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController *picker = [[[UIImagePickerController alloc] init]autorelease];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
picker.delegate = self;
picker.showsCameraControls=YES;
picker.allowsEditing = NO;
UIView *overlayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
picker.cameraOverlayView = overlayView;
[controller presentModalViewController:picker animated:YES];
}
return YES;
}
谢谢你, 马丹·莫汉。
Thanks to all for responding to the questions which I posted.
I got one problem that is, while capturing the video in the iPhone, I don't know how to store the time period (duration) that I captured video with iPhone. Can any one solve my problem.
I am using the following code for capturing.
-(void) RecordVideoWithCamera
{
printf("\n Hai I am in record vedio with camera -============");
[self startCameraPickerFromViewController:self usingDelegate:self];
}
- (BOOL)startCameraPickerFromViewController:(UIViewController*)controller usingDelegate:(id<UIImagePickerControllerDelegate>)delegateObject
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIImagePickerController *picker = [[[UIImagePickerController alloc] init]autorelease];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
picker.delegate = self;
picker.showsCameraControls=YES;
picker.allowsEditing = NO;
UIView *overlayView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
picker.cameraOverlayView = overlayView;
[controller presentModalViewController:picker animated:YES];
}
return YES;
}
Thanking you,
Madan Mohan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该检查 CMTime 结构。
I think you should check CMTime struct.