开发者

Capture Video and Audio and write it to server in iPhone

开发者 https://www.devze.com 2023-02-14 14:29 出处:网络
I tried to capture video and write it to following url.I am getting this error. Code: videoURL = [[NSURL alloc] initWithString:@\"http://belterra.webiguide.com/uploadimages/VideoRecord.mpeg4\"];

I tried to capture video and write it to following url.I am getting this error.

Code:

videoURL = [[NSURL alloc] initWithString:@"http://belterra.webiguide.com/uploadimages/VideoRecord.mpeg4"];

_videoWriter = [[AVAssetWriter alloc] initWithURL:videoURL fileType:AVFileTypeQuickTimeMovie
                                            error:&error];

Exception:

Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '*** -[AVAssetWriter initWithURL:fileType:error:] 
invalid parameter not satisfying: [outputURL isFileURL]'
    **开发者_C百科* Call stack at first throw:
    (
        0   CoreFoundation           0x314d0987 __exceptionPreprocess + 114
        1   libobjc.A.dylib          0x319a149d objc_exception_throw + 24
        2   AVFoundation             0x30690421 -[AVAssetWriter initWithURL:fileType:error:] + 188
        3   iChat                    0x00003155 -[AVCaptureVideo setupWriter] + 116
        4   iChat                    0x000030a3 -[AVCaptureVideo startVideoRecording] + 26
        5   iChat                    0x000039ed -[AVCaptureVideo initCapture] + 1112

<snip>

    )


invalid parameter not satisfying: [outputURL isFileURL]'

It looks like it's expecting a local file path but in URL format e.g. file://....

from the docs

Initializes an asset writer for writing to the file identified by a given URL in a format specified by a given UTI.

You would then have to manage the upload to your webserver separately.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号