3

As in the current iOS SDK there is no way to get compressed frames from video, how could we implement live streaming like skype did? The only way I see now is:

  1. obtain uncompressed frames from AVCaptureVideoDataOutput
  2. compress these frames using third-party library
  3. send frames to server

Are there any other ways to accomplish this task? What libraries can be used for compression and are they compatible with appstore? Thanks in advance

peetonn
  • 2,942
  • 4
  • 32
  • 49
  • Found some information about this, see another [topic][1] [1]: http://stackoverflow.com/questions/7979842/video-encoding-libraries-for-ios – peetonn Nov 12 '11 at 13:25

1 Answers1

3

I'm struggling with this, too. The ffmpeg library seems like it works for compression, but the licensing means you have to release your source code.

You can set your object as a delegate from AVCaptureVideoDataOutput and implement this callback on a dispatch queue:

  • (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection;

Then you'll get the uncompressed video which you can process into a uiimage or jpeg (Apple has code samples for this), but there's no way to get the hardware compressed H264 frames, which is what we really want. This is where you could implement a library like ffmpeg to compress the video into H264 or whatever.

Currently, I'm trying to see if I can interpret the AVAssetWriter file output and redirect that to a stream (it can write hardware-compressed video), but Apple seems to be making this hard for some reason.

Let me know if you find something that works.

dwsolberg
  • 879
  • 9
  • 8
  • hey, check another my thread here http://stackoverflow.com/questions/7979842/video-encoding-libraries-for-ios. i've found foxit solutions library implementing hardware encoding. – peetonn Nov 30 '11 at 00:05
  • @dwsolberg Did you find any solution to redirect AVAssetWriter file output to a stream. I am looking for the same or in simple words I am looking for encoding a video frame. – Evol Gate Nov 26 '12 at 11:00