2

Good day.

I have a ip camera. From it frame by frame comes stream h264.

On the Internet, in particular on stackoverflow, a lot of information about how to decode h264 on iOS. But this information is not clear. I ask you to show me an example and show right direction of how to decode a frame by frame h264 stream to iOS 7.

What options I have seen and what I know about them:

  • ffmpeg - not suitable for me, as it has LGPL license.

  • AVAnimator library - license inappropriate for me.

  • Hardware decoder - the best solution, but as I understand it, is only available for iOS 8.

For me to be the perfect option if you give me an example for correct decoding h264 stream and display it on the way to the screen.

Regards.

Andrew Z.
  • 67
  • 2
  • 7
  • The hardware decoder for iOS 8 only is your only hope. ffmpeg might support the format you want, but it is very slow and the license means you cannot use it in a real product. AVAnimator does not even attempt to implement h.264 decoding as it is an animation/sync library. You might be much better off just building a server side ffmpeg component that accepts the h.264 frame by frame and then converts to PNG or some other stream friendly format that can be more easily decoded on the client side. You might be able to get rational compressed sizes with a compressed format like JPEG2000. – MoDJ Jun 05 '15 at 23:28

2 Answers2

4

You need a 3rd party H.264 decoder - you could try https://github.com/cisco/openh264 But going to iOS 8 would make it a lot easier.

Markus Schumann
  • 7,636
  • 1
  • 21
  • 27
4

Like Markus said, switching to iOS 8 and using the VideoToolbox framework (hardware accelerated decoding) would probably be your best option. If you're not sure how to use VideoToolbox, I have an example "How to use VideoToolbox to decompress H.264 video stream" that might help you.

As you can see on 9to5mac.com, 77% of all iPhone users are on iOS8 so it's probably in your interest to start developing for iOS8.

Community
  • 1
  • 1
Olivia Stork
  • 4,660
  • 5
  • 27
  • 40