ios - How to decode multiple videos simultaneously using AVAssetReader? -
i'm trying decode frames multiple video files, , use them opengl texture.
i know how decode h264 file using avassetreader object, seems have read frames after call startreading
in while
loop when status
avassetreaderstatusreading
. want call startreading
call copynextsamplebuffer
anywhere anytime want. in way, can create new video reader class avassetreader, , load video frames multiple video files whenever want use them opengl textures.
is doable?
short answer yes, can decode 1 frame @ time. need manage decode logic , simple thing allocate buffer of bgra pixels , copy framebuffer data temp buffer. warned not able find little code snippit this. thing is, streaming data movies opengl not easy implement. suggest avoid attempting , use 3rd party library implements hard stuff. if want see complete example of implemented can have @ blog post load opengl textures alpha channel on ios. post shows how stream video opengl need decode h.264 disk first using approach. should possible use other libraries same thing, keep in mind playing multiple videos @ same time resource intensive, may run limits of can done on hardware device quickly. also, if not need opengl textures, lot easier operate on coregraphics apis directly under ios.
Comments
Post a Comment