1

I making a iOS video player using ffmpeg, the flow likes this:

Video File---> [FFMPEG Decoder] --> decoded frames --> [a media director] --> /iphone screen (full and partial)/

A media director will handle the tasks of rendering decoded video frames to iOS ui (UIView, UIWindow etc), outputting audio samples to iOS speaker, and threads management.

SDL is one of those libs, but SDL is mainly made for game making purpose and seem to be not really mature for iOS.

What can be the substitute for SDL?

jAckOdE
  • 2,402
  • 8
  • 37
  • 67

2 Answers2

1

On Mac OS X I used CoreImage/CoreVideo for this, decoding frame into a CVImageBuffer and rendering them into a CoreImage context. I'm not sure CoreImage contexts are supported on iOS though. Maybe this thread will help on this: How to turn a CVPixelBuffer into a UIImage?

A better way on iOS might be to draw your frames with OpenGLES.

Community
  • 1
  • 1
Taum
  • 2,511
  • 18
  • 18
  • thanks, I believe there are similar frame work in iOS. There will be more work to draw frames directly using OpenGLES than using SDL, and SDL is actually built on top of OpenGLES (correct me if i'm wrong). – jAckOdE Oct 18 '12 at 00:10
  • Actually that may not be the case, it depends how much functionality you need. If you just want to capture frames and audio say from a camera I recommend using iOS api + ffmpeg, if you need perfect av/sync , subtitle support etc. than it would be more difficult but not insurmountable with apple api. here's a tutorial that will give you some idea's for using the api http://sol3.typepad.com/exotic_particles/tutorials/ – Michelle Cannon Oct 19 '12 at 13:41
1

SDL uses opengl and FFMpeg, you can come pretty close using ffmpeg and apple native api's functions. We've done it with several video players.

This certainly will get you started.

https://github.com/mooncatventures-group

Michelle Cannon
  • 1,341
  • 8
  • 8