Custom AVAsset?

Hi,


I need to create an AVAsset that provides a video stream from data that I have buffered in memory from an RTSP server. I don't understand how to do this.


According to the documentation, "It is not currently possible to subclass AVAsset to handle streaming protocols or file formats that are not supported by the framework". The only concrete subclass of AVAsset is AVURLAsset. I tried initializing an AVAsset with an RTSP URL, but it didn't work.


My questions are:


1. Is RTSP in fact not a protocol that is supported by the framework?


2. Is there in fact no other way to generate a custom asset except by providing the data through a URL?


3. Would I be able to solve the problem by creating a custom URL Protocol? Is this the right way to do what I need?


4. Should I be thinking about this at the track level instead of the asset level, and subclassing AVAssetTrack instead of AVAsset? I looked at AVAssetTrack and found that it mostly contains metadata -- I don't see anything there about providing the underlying track data.


5. Are there any known 3rd party libraries or plug-ins that I could license which would help me accomplish this?


Thanks,

Frank

Replies

I can only answer some of these:


RTSP is *not* a supported protocol.

You can't subclass AVAsset or AVAssetTrack.


The way people do this is they create local HTTP server on the device and have that server convert the RTSP into HLS.

In that way AVFoundation gets an HTTP URL.

My recollection is this is only allowed if you are connecting via WiFI.

Thanks for the reply. I arrived at the same conclusions eventually, but it is nice to see them corroborated by another developer.


Setting up an internal HLS server is something we considered, but ended up going with another solution.


I'm a bit surprised that Apple doesn't provide more support for low-level video processing in iOS. I have built a number of Core Audio applications in iOS where I was able to do things like generate audio samples on the fly. Video by comparison seems much more limited.


Frank