We want to make live streaming to iOS device Where input streams are from flash (Audio Codec - Nellymoser and Video Codec- sorenson spark/h.263/h.264) and output streams require HLS (Audio Codec - AAC and Video Codec- H.264).
We have faced 2 problems -
1 - How to convert audio codec nellymoser to AAC ?
Wowza transcoder addOn is not supported nellymoser as input
so, We are working with FFMPEG to transocode input stream from flash (Audio Codec - Nellymoser and Video Codec- sorenson spark/h.263/h.264) to required output stream (Audio Codec - AAC and Video Codec- H.264).
FFmpeg command used :
ffmpeg -i rtmp://[Wowza IP Address]:1935/DemoApp/testing -c:a libvo_aacenc -ar 44100 -ab 48k -c:v libx264 -preset ultrafast -tune zerolatency -r 24 -g 48 k -keyint_min 48 -f flv rtmp://[Wowza IP Address]:1935/DemoApp/testingios
It fulfilled our requirement but we are facing a
DELAY in HLS, Significant delay (arround 10 to 15 Sec). We need optimised delay.
We have worked with Key frame as well. We have optimised our packetization settings like cupertinoChunkDurationTarget =2000 and -r 24 -g 48 k -keyint_min 48 at FFmpeg side.But there is still delay in iOS side.
Are you referring to start time or latency, or both? Start time is how long it takes for a user to start seeing video after starting playback. Latency is how far behind the stream is compared to the encoder.
Can you show several of those lines? Wowza shows the 10 of them (it continues chunking of course but only logs 10)
The one you show is 2 seconds duration and has one key frame, which is right according to your FFmpeg command which shows a 2 second key frame frequency ( -r 24 -g 48 k -keyint_min 48 ), and indicates cupertinoChunkDurationTarget is "2000". If you change -g to 24 you will have 1 second key frame frequency, then you can make cupertinoChunkDurationTarget 1000, which should yield packets about like this: a/v/k:14/8/1 duration:1000.
The cupertino settings are good in that you are getting a consistent 2 second chunk with 1 key frame. You can do the same with
smooth streaming following this guide (or you might want to remove the smoothstreamingpacketizer if you are not using a Silverlight player).
How are you testing? Is it local or remote, is it iOS device or HLS desktop playback with JW Player or VLC? What is the bitrate of the stream (not evident in your ffmpeg command)?
You can go down to 1 second key frame frequency and chunkDurationTarget 1000. You can reduce the bitrate of the stream. You can remove network factors if you are testing remote to see what the delay is without that. Understand that iOS devices need 3 chunks before playback, so if the bitrate is very high and the device is remote and a slower connection, it still has to download 3 large chunks.