Skip to main content
Participating Frequently
April 8, 2013
Answered

Streaming FLV files over HLS-VOD to iOS.

  • April 8, 2013
  • 2 replies
  • 4416 views

We are using AMS 5.0.1 to live publish over RTMP. These store on the server in FLV format. We have developed Android and Desktop solutions that are working wonderfully.

We are looking to build an iOS solution that will be playback only. HLS-VOD seems to the path of least resistance for this. This is configured on the server, and it streams f4v files to our iOS app fine. However, attempting to stream an FLV ends in a bad request.

http://fms.dev/hls-vod/intro/374/1920_1365014957078.flv.m3u8 -> 400 bad request
Apache Error Log reads:  [error] mod_hlshttp [400]: Invalid file 1920_1365014957078.flv - File format not supported for Media file

It appears FLV format is not supported for media files, but it's the default format for published streams?? What's the best way for us to stream our FLV files to an iOS device? Our application is written in Objective C and we are not considering AIR an option.

This topic has been closed for replies.
Correct answer

Thanks, I was expecting that ultimately I may have to do that. I explored  that this morning. I am able to publish to mp4/f4v and it works fine with my desktop player. Requesting it via hls produces a good m3u8 file. However, when my iOS app attempts to stream the video, it fails.

I found this in the apache logs:

[error] mod_hlshttp [500]: Packaging error 2 (The media contains unsupported video codec) when processing /hls-vod/test/jbethke2.f4vFrag1Num0.ts

The error suggests that AMS does not like the codec of my resulting f4v.  Upon inspection of the video, I noticed that it's encoded in H.263. The NetStream.publish() documentation indicates this is appropriate. It also explains that it can not publish an H.264 stream from flash video.  Is AMS expecting an H.264? Further recommendations?


Hi,

HLS requires H264 video codec. If you're using Flash Player to publish the stream, you can use Flash Player 11 onwards to publish H264 stream. You can read about it here: http://www.adobe.com/devnet/adobe-media-server/articles/encoding-live-video-h264.html.

Also, please note that Flash Player is only capable of publishing speex or nelly moser audio codec, both of which is not supported on iOS. Currently the only workaround for this is to have an encoder like ffmpeg in between that encodes the audio to aac or heaac.

Thanks,
Apurva

2 replies

Participating Frequently
April 8, 2013

FYI, there is a similiar inquiry from about a year ago, but unsolved: http://forums.adobe.com/message/5217176

April 9, 2013

Hi,

FMS cannot convert flv files to f4v/mp4's on the fly. You'll have to do the conversion manually. However, I suggest you record all future streams directly in mp4 format by recording it as mp4:<streamname>.mp4.

Thanks,

Apurva

Participating Frequently
April 9, 2013

Thanks, I was expecting that ultimately I may have to do that. I explored  that this morning. I am able to publish to mp4/f4v and it works fine with my desktop player. Requesting it via hls produces a good m3u8 file. However, when my iOS app attempts to stream the video, it fails.

I found this in the apache logs:

[error] mod_hlshttp [500]: Packaging error 2 (The media contains unsupported video codec) when processing /hls-vod/test/jbethke2.f4vFrag1Num0.ts

The error suggests that AMS does not like the codec of my resulting f4v.  Upon inspection of the video, I noticed that it's encoded in H.263. The NetStream.publish() documentation indicates this is appropriate. It also explains that it can not publish an H.264 stream from flash video.  Is AMS expecting an H.264? Further recommendations?

Participating Frequently
April 8, 2013

Note that if I convert my flv to f4v, it works.  Problem is that I am taking in hundreds of FLV files per day. Reencoding and storing each would add excessive overhead.

I would think AMS is capable of live encoding flv to hls's mp4 based format. I just can't find the documentation on how.