Search code examples
iphoneiossocketsios4avassetwriter

Is it possible to route AVAssetWriter to a network stream in iOS4?


AVAssetWriter takes a file URL as an argument and writes buffers appended to its AVAssetWriterInput to that file.

AVAssetWriter* assetWriter = [[AVAssetWriter alloc]
    initWithURL:[NSURL URLWithString:@"...fileURL..."]
    fileType:AVFileTypeMPEG4
    error:&error];

If a network URL is specified (i.e. RTSP - a server expecting a live streaming source), an exception is thrown as a file-based URL is required.

Is there another way of accessing the asset writer output? I want to take advantage of the integrated H.264 encoding and just access the encoded data bit by bit to stream it over the network.


Solution

  • No.

    Capture the raw samples instead.