【问题标题】:How to store the time period(duration) of a captured video in iPhone?如何在 iPhone 中存储捕获的视频的时间段(持续时间)?
【发布时间】:2010-09-21 06:20:10
【问题描述】:

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

我遇到了一个问题,即在 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;  
}  

谢谢你, 马丹·莫汉。

【问题讨论】:

    标签: iphone objective-c video-capture duration


    【解决方案1】:

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

    【讨论】:

    • 我没有得到,有没有示例代码可以使用它。请提供更多详细信息。
    • 对不起我之前的帖子,发错了。关于你的问题。我不知道返回当前录制视频持续时间的 UIImagePickerController 的任何属性或方法,我认为您可以使用 NSTimer 自己实现它,在开始录制时启动它并在其选择器中增加时间变量。
    • 有没有其他方法可以代替NSTimer?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-26
    • 1970-01-01
    • 1970-01-01
    • 2020-03-17
    • 2011-08-23
    • 1970-01-01
    相关资源
    最近更新 更多