Skip to main content
IGZN
Inspiring
June 1, 2016
Question

Has anyone ever successfully played a H264 live stream on iOS?

  • June 1, 2016
  • 3 replies
  • 2377 views

Hi fellas,

The last couple of weeks were really frustrating for me, I'm trying to play live h264 streams on mobile devices (with AIR, of course).

Naturally I tried NetStream over RTMP, which plays fine on Adnroid, but because of the buffering thing on iOS, I can only hear sound, so it's a no-go.

I tried running an HTTP server with m3u8 playlist (HLS streaming) but NetStream.play( URL of the playlist ) just doesn't do anything, although it's mentioned in ActionScript documentation as the correct way to play a stream on iOS.

I tried OSMF and HLS plugins for OSMF and still no luck.

After I pulled out half of my hair, I finally gave up and started to use FLVs with Sorenson Spark / Nellymoser codecs which (aside from the crappy quality at high bitrate) looks to be working fine. However it puts extra load on the encoding servers.

My question is:

Has anyone ever successfully managed to play a visible live h264 stream on iOS in AIR? At this point I accept any solutions, really, cos I'm at the edge, and about to start writing a native extension that displays a HLS video.

Thanks for your time

This topic has been closed for replies.

3 replies

leop66344762
Inspiring
August 26, 2016

Hi chris.campbell,

I would like to know it is on the plans of the team to support h264 RTMP streaming on iOS, and if not, what are the alternatives?

The implementation requires very low latency (video conferences) so I suspect HLS would not cope with that.

Thank you in advance.

Leo

IGZN
IGZNAuthor
Inspiring
June 2, 2016

I dug even further:

I thought maybe something's not right with how I encode the streams and create the playlists, so I installed the latest Adobe Media Server to see how the samples work.

NetStream.play( url_of_the_playlist ) doesn't do anything, if it's attached to a Video object, it throws a StreamNotFound error, for StageVideo there's not even an error. (Happens on Android/Desktop/iOS). If I directly access the playlist from an iOS video player (not AIR) it plays properly.

NetStream.play( url_of_the_f4v_file ) plays fine on Desktop/Android, and doesn't play on iOS.

So I'm really stuck at this point. It would be nice from Adobe just to say something like "you'll never be able to play a h264 stream on iOS in AIR. period." It would spare me (and the rest of us) some precious time, cos the AS3 reference says that

Special considerations for H.264 video in AIR 3.0 for iOS

For H.264 video, the iOS APIs for video playback accept only a URL to a file or stream. You cannot pass in a buffer of H264 video data to be decoded. Depending on your video source, pass the appropriate argument to NetStream.play() as follows:

  • For progressive playback: Pass the URL of the file (local or remote).
  • For streaming video: Pass the URL of a playlist in Apple's HTTP Live Streaming (HLS) format. This file can be hosted by any server; Flash Media Server 4.5 and higher has the advantage of being able to encode streams in HLS format.

Thanks

Colin Holgate
Inspiring
June 1, 2016

I haven't done live video, but had a thought about something that might help. Net stream to a video object may not cope with hardware decoding, and live streams could be relying on that. Have you tried StageVideo? I have played local and remote H.264, with perfect performance.

I am most likely wrong about this, but it would explain the symptoms.

If you do use StageVideo don't forget to add the hardware acceleration requirement to the app descriptor for Android.

IGZN
IGZNAuthor
Inspiring
June 1, 2016

Hi Colin,

Yes, of course I tried StageVideo, and although it works on Android, it doesn't work on iOS because of the buffering thing.

And to get the Sorenson stream working I had to use Video objects and software decoding which of course puts more load on the devices.

Colin Holgate
Inspiring
June 1, 2016

For my interest, do you know of a public live feed that I could do tests on, in the hope that I think of other solutions? An H.264 one in particular.