Problems with NSInputstream
I created my own class
MediaInputStream which is inherited from
NSInputstream to do some customer process with the stream.
Here is some problems i have encountered.
stream object not retained
The stream instance object is not retained by the
VLCMieda after passing to the initiate method. then it seems like been replaced by a new object.
MediaInputStream *stream = [MediaInputStream inputStreamWithURL:_assetURL]; VLCMedia *med = [[VLCMedia alloc] initWithStream:stream]; self.player.media = med; // after passing to [VLCMedia initWithStream:], the stream instance is deallocated
to make it working, i have to keep a reference to the stream object.
the initial length of data reading is too large
the initial reading from the stream is up to 16M bytes, which is ok for local file streaming.
but i need to enable online video, so i have to create a stream from network file (a http request to the file url), if the initial request is too large, it would cost longer time, and too much data transfer.
.mkv/.avi file are not supported
I found stream is available for a small kind of video format like mp4, mov, how to support other file format like .mkv .avi etc.?