OK here’s the complete setup. We are running a daycare and have cameras in all rooms. Because we were hitting our bandwidth limits at the building with lots of parents trying to connect to the cameras simultaneously, we moved to distributing the streams via Wowza running in the cloud. So here goes:
Cameras are Axis 212 PTZ cameras. These are older models that only spit out MPEG-4 video (no h264).
We then run an Amazon EC2 instance which acts as the Transcoder. It’s a vanilla ubuntu box that runs ffmpeg on boot-up (we can’t afford the Wowza transcoder much as we would like to). Here is the ffmpeg command:
/usr/local/bin/ffmpeg -i rtsp://[CAMERA_URL]:[PORT]/mpeg4/media.amp -an -vcodec libx264 -f flv rtmp://[WOWZA_SERVER]:[WOWZA_PORT]/[APP_NAME]/[STREAM_NAME].stream
Wowza (v4.0.3) itself is running on another Amazon EC2 device. No worries there.
On our website, we have JW Player 6 (Free edition). Here is the code for that:
<div style='margin:0 auto; width: 640px;'>
<div id='player1'><a href='rtsp://[WOWZA_SERVER]:80/[APP_NAME]/[STREAM_NAME].stream'>Click here to view the webcam.</a></div>
</div>
<script type='text/javascript'>
jwplayer('player1').setup({
aspectratio: '4:3',
width: '100%',
autostart: 'true',
primary: 'flash',
fallback: 'false',
androidhls: 'true',
playlist: [{
image: 'http://abcacademy.ca/img/webcam_bg.jpg',
sources: [
{ file: 'rtmpt://[WOWZA_SERVER]:80/[APP_NAME]/[STREAM_NAME].stream.stream'},
{ file: 'rtmp://[WOWZA_SERVER]:80/[APP_NAME]/[STREAM_NAME].stream.stream'},
{ file: 'http://[WOWZA_SERVER]:80/[APP_NAME]/[STREAM_NAME].stream.stream/playlist.m3u8'},
{ file: 'rtsp://[WOWZA_SERVER]:80/[APP_NAME]/[STREAM_NAME].stream.stream'}
]
}]
});
</script>
OK. so far so good. Delivery of the stream to desktop browsers is fine. What we are seeing is that mobile devices are getting the stream almost 5-10 minutes behind real-time and the desktop stream. If i point my android directly to the Wowza rtsp URL, it comes at real-time, but using the JW player HLS stream delays it by minutes. Can anyone point out where i might be going wrong? Is this an Wowza/HLS thing, or a JW player issue? Can’t tell from the desktops as we are not using the premium JWP edition which would deliver HLS to the desktop flash-enabled browser.
Thanks