如何在 iPhone 中存储捕获视频的时间段(持续时间)?

发布于 2024-09-20 00:24:17 字数 1204 浏览 6 评论 0原文

感谢大家对我发布的问题的答复。

我遇到一个问题,在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

就像说晚安 2024-09-27 00:24:17

我认为你应该检查 CMTime 结构。

I think you should check CMTime struct.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文