Захват видео и аудио и запись на сервер в iPhone - PullRequest
1 голос
/ 02 марта 2011

Я пытался захватить видео и записать его на следующий URL. Я получаю эту ошибку.

Код:

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

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

Исключение:

Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '*** -[AVAssetWriter initWithURL:fileType:error:] 
invalid parameter not satisfying: [outputURL isFileURL]'
    *** 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>

    )

1 Ответ

2 голосов
/ 02 марта 2011

invalid parameter not satisfying: [outputURL isFileURL]'

Похоже, он ожидает локальный путь к файлу, но в формате URL, например, file://....

из документов

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

Затем вам придется отдельно управлять загрузкой на ваш веб-сервер.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...