1

I've been exploring options on iOS to achieve hardware accelerated decoding of raw H.264 stream and so far I only found that the only option is to write the H.264 stream into an MP4 file and then pass the file to an instance of AVAssetReader. Although this method works, it's not particulary suitable for realtime applications. AVFoundation reference indicates the existence of a CALayer that can display compressed video frames (AVSampleBufferDisplayLayer) and I believe this would be a valid alternative to the method mentioned above. Unfortunately this layer is only available on OSX. I would like to file an enchament radar but before I do so I would like to know from someone that has experience with this layer if indeed could be use to display H.264 raw data if was available on iOS. Currently in my app, the decompressed YUV frames are rendered via openGLES. Using this layer means that I will not need to use openGLES anymore?

Glauco
  • 495
  • 1
  • 7
  • 17
  • AVSampleBufferDisplayLayer is not available on iOS. – Rhythmic Fistman Mar 20 '14 at 05:19
  • I know that is not available, see my question: "Unfortunately this layer is only available on OSX". What I'm asking to anyone that has experience with using this type of CALayer if it's suitable to display H.264 encoded images – Glauco Mar 20 '14 at 06:39
  • Oops, sorry. So AVSampleBufferDisplayLayer looks like exactly the sort of thing that could replace your GLES implementation. – Rhythmic Fistman Mar 20 '14 at 06:53

1 Answers1

2

In iOS 8 the AVSampleBufferDisplayLayer class is available now.

Take a Look and have Fun

Zappel
  • 268
  • 3
  • 13
  • @Karsten: Do you have an working example? Because I am trying to get it working, but there is nothing displayed: http://stackoverflow.com/questions/25980070/how-to-use-avsamplebufferdisplaylayer-in-ios-8-for-rtp-h264-streams-with-gstream – Zappel Sep 25 '14 at 08:53
  • I provided some code snippets. => http://stackoverflow.com/questions/26035380/how-avsamplebufferdisplaylayer-displays-h-264/26035381#26035381 – Karsten Sep 25 '14 at 09:46
  • @Karsten: thanks for providing the snippets. But I had the same problems as Md1079 because I want to decode an RTP Stream from network. I want to comment his answer, but my reputation does not allow it :( Besides, the problem is solved now, and I can decode the network stream. – Zappel Sep 26 '14 at 14:23