System Overview
Canon VB-C50i
Axis
EC2 Inst. - FFServer (Elastic IP)
EC2 Inst. - Wowza (Elastic IP)
The Canon is streaming at 3fps in MJPEG which is feed into ffmpeg for conversion to H.264. Wowza is configured to rebroadcast the ffserver stream.
Rebroadcasting the Axis H.264 stream works on all clients (RTSP, RTMP and iPhone). However, rebroadcasting the ffserver stream does not work reliably over RTSP. It is very hit and miss if an RTSP stream comes through. Streaming with VLC or a an android phone directly from ffserver woks fine. I would prefer to stream through Wowza as I have more control over the content. What RTSP settings should I be looking at to tune this?
Update: (I am new to this, so please excuse my ignorance)
This appears to be a bit rate issue. I had ffmpeg set at a target rate of 50k. I bumped this up to 200k and everything sorted itself out. I still think it should work at the lower bit rates. Is there something I can set to get the stream to just play whatever arrives? It works fine when streaming directly from ffserver so I suspect this can be set somewhere. I have appended a VLC dump from ffserver.
Update 2: If I set the ffmpeg output to 15FPS with a target bitrate of 200kbs the problems disappear. Even when only feeding ffmpeg with 5fps. This also clears up the 5+ second buffering in the Flash player. Any pointers would be greatly appreciated.
Here is a dump from VLC of when it was successful
main debug: Activated
main debug: rebuilding array of current - root Playlist
main debug: rebuild done - 0 items, index -1
main debug: looking for services probe module: 5 candidates
main debug: no services probe module matching "any" could be loaded
main debug: TIMER module_need() : 190.020 ms - Total 190.020 ms / 1 intvls (Avg 190.020 ms)
macosx debug: using Snow Leopard AR cookies
macosx debug: notification received in VLC with name VLCOSXGUIInit and object VLCEyeTVSupport
main debug: looking for services probe module: 5 candidates
main debug: no services probe module matching "any" could be loaded
main debug: TIMER module_need() : 5.526 ms - Total 5.526 ms / 1 intvls (Avg 5.526 ms)
main debug: adding item `rtsp://:<removed>)
main debug: rebuilding array of current - root Playlist
main debug: rebuild done - 1 items, index -1
main debug: processing request item rtsp://<removed>
node Playlist skip 0
main debug: resyncing on rtsp://<removed>
main debug: rtsp://<removed> is at 0
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for 'rtsp://<removed>'
main debug: thread (input) created at priority 22 (input/input.c:214)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path '/tmp'
main debug: `rtsp://<removed>' gives access `rtsp' demux `' path `<removed>'
main debug: creating demux: access='rtsp' demux='' path='<removed>'
main debug: looking for access_demux module: 1 candidate
macosx debug: input has changed, refreshing interface
live555 debug: RTP subsession 'video/H264'
main debug: selecting program id=0
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: We have a timeout of 60 seconds
live555 debug: spawned timeout thread
live555 debug: play start: 0.000000 stop:0.000000
main debug: using access_demux module "live555"
main debug: TIMER module_need() : 1538.884 ms - Total 1538.884 ms / 1 intvls (Avg 1538.884 ms)
main debug: looking for decoder module: 31 candidates
avcodec debug: libavcodec initialized (interface 0x345e03)
avcodec debug: trying to use direct rendering
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 429.147 ms - Total 429.147 ms / 1 intvls (Avg 429.147 ms)
main debug: looking for packetizer module: 21 candidates
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
main debug: using packetizer module "packetizer_h264"
main debug: TIMER module_need() : 30.639 ms - Total 30.639 ms / 1 intvls (Avg 30.639 ms)
main debug: thread (decoder) created at priority 0 (input/decoder.c:301)
main debug: thread started
main debug: looking for meta reader module: 2 candidates
lua debug: Trying Lua scripts in
lua debug: Trying Lua scripts in
lua debug: Trying Lua playlist script
lua debug: Trying Lua scripts in
main debug: no meta reader module matching "any" could be loaded
main debug: TIMER module_need() : 1.195 ms - Total 1.195 ms / 1 intvls (Avg 1.195 ms)
main debug: `<removed>' successfully opened
live555 warning: no data received in 10s. Switching to TCP
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) stopped
main debug: removing module "avcodec"
main debug: killing decoder fourcc `h264', 0 PES in FIFO
main debug: removing module "packetizer_h264"
main debug: Program doesn't contain anymore ES
live555 debug: RTP subsession 'video/H264'
main debug: looking for decoder module: 31 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 4.829 ms - Total 4.829 ms / 1 intvls (Avg 4.829 ms)
main debug: looking for packetizer module: 21 candidates
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
main debug: using packetizer module "packetizer_h264"
main debug: TIMER module_need() : 0.389 ms - Total 0.389 ms / 1 intvls (Avg 0.389 ms)
main debug: thread (decoder) created at priority 0 (input/decoder.c:301)
main debug: thread started
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: play start: 0.000000 stop:0.000000
live555 debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
main debug: ES_OUT_RESET_PCR called
main debug: Buffering 0%
main debug: Buffering 16%
main debug: Buffering 33%
main debug: no usable vout present, spawning one
main debug: looking for text renderer module: 3 candidates
main debug: using text renderer module "quartztext"
main debug: TIMER module_need() : 20.972 ms - Total 20.972 ms / 1 intvls (Avg 20.972 ms)
main debug: looking for video filter2 module: 15 candidates
swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: YUVA with scaling using Bicubic (good quality)
main debug: using video filter2 module "swscale"
main debug: TIMER module_need() : 24.920 ms - Total 24.920 ms / 1 intvls (Avg 24.920 ms)
main debug: looking for video filter2 module: 15 candidates
yuvp debug: YUVP to YUVA converter
main debug: using video filter2 module "yuvp"
main debug: TIMER module_need() : 44.990 ms - Total 44.990 ms / 1 intvls (Avg 44.990 ms)
main debug: window size: 320x240
main debug: Deinterlacing available
main debug: deinterlace 0, mode blend, is_needed 0
main debug: looking for video output module: 2 candidates
main debug: looking for opengl provider module: 2 candidates
macosx debug: display is Quartz Extreme accelerated
main debug: Buffering 50%
main debug: Buffering 66%
main debug: using opengl provider module "macosx"
main debug: TIMER module_need() : 395.794 ms - Total 395.794 ms / 1 intvls (Avg 395.794 ms)
main debug: using video output module "opengl"
main debug: TIMER module_need() : 407.596 ms - Total 407.596 ms / 1 intvls (Avg 407.596 ms)
main debug: got 1 direct buffer(s)
main debug: pic render sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: pic in sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: pic out sz 320x240, of (0,0), vsz 320x240, 4cc UYVY, sar 1:1, msk r0x0 g0x0 b0x0
main debug: looking for video filter2 module: 15 candidates
main debug: using video filter2 module "i420_yuy2_sse2"
main debug: TIMER module_need() : 0.287 ms - Total 0.287 ms / 1 intvls (Avg 0.287 ms)
main debug: indirect render, mapping render pictures 0-24 to system pictures 1-25
avcodec debug: using direct rendering
main debug: End of video preroll
main debug: Received first picture
main debug: Post-processing available
main warning: vlc_object_find_name(postproc) is not safe!
main debug: Buffering 83%
main debug: Buffering 100%
main debug: looking for video blending module: 1 candidate
blend debug: chroma: YUVA -> UYVY
main debug: using video blending module "blend"
main debug: TIMER module_need() : 25.443 ms - Total 25.443 ms / 1 intvls (Avg 25.443 ms)
main debug: Stream buffering done (1400 ms in 1232 ms)
main debug: Decoder buffering done in 1 ms
main warning: late picture skipped (108223 > -161)
main debug: incoming request - stopping current input
When it fails I receive this
main debug: `<removed>' successfully opened
live555 warning: no data received in 10s. Switching to TCP
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) stopped
main debug: removing module "avcodec"
main debug: killing decoder fourcc `h264', 0 PES in FIFO
main debug: removing module "packetizer_h264"
main debug: Program doesn't contain anymore ES
live555 debug: RTP subsession 'video/H264'
main debug: looking for decoder module: 31 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 1.817 ms - Total 1.817 ms / 1 intvls (Avg 1.817 ms)
main debug: looking for packetizer module: 21 candidates
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
main debug: using packetizer module "packetizer_h264"
main debug: TIMER module_need() : 0.288 ms - Total 0.288 ms / 1 intvls (Avg 0.288 ms)
main debug: thread (decoder) created at priority 0 (input/decoder.c:301)
main debug: thread started
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: play start: 0.000000 stop:0.000000
live555 error: no data received in 10s, aborting
main debug: EOF reached
main debug: finished input
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) stopped
main debug: removing module "avcodec"
main debug: killing decoder fourcc `h264', 0 PES in FIFO
main debug: removing module "packetizer_h264"
macosx debug: input has stopped, refreshing interface
macosx debug: input has changed, refreshing interface
macosx debug: input has stopped, refreshing interface
main debug: removing module "live555"
main debug: Program doesn't contain anymore ES
main debug: thread ended
main debug: dead input
main debug: TIMER input launching for <removed>' : 1308.189 ms - Total 1308.189 ms / 1 intvls (Avg 1308.189 ms)
main debug: changing item without a request (current 0/1)
main debug: nothing to play
When if fails, which is more often then not, I can pull up the stream from Flash or iOS with no problems. When I am testing I usually have Flash running all the time to make sure the cam is really up.
ffserver VLC output (50kbs stream)
main debug: processing request item <removed> node Playlist skip 0
main debug: resyncing on <removed>
main debug: <removed> is at 0
main debug: starting new item
main debug: creating new input thread
main debug: Creating an input for '<removed>'
main debug: thread (input) created at priority 22 (input/input.c:214)
main debug: thread started
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path '/tmp'
main debug: `<removed>' gives access `rtsp' demux `' path `<removed>'
main debug: creating demux: access='rtsp' demux='' path='<removed>'
main debug: looking for access_demux module: 1 candidate
macosx debug: input has changed, refreshing interface
live555 debug: RTP subsession 'video/H264'
main debug: selecting program id=0
live555 debug: setup start: 0.000000 stop:0.000000
live555 debug: play start: 0.000000 stop:0.000000
main debug: using access_demux module "live555"
main debug: TIMER module_need() : 643.781 ms - Total 643.781 ms / 1 intvls (Avg 643.781 ms)
main debug: looking for decoder module: 31 candidates
avcodec debug: libavcodec already initialized
avcodec debug: trying to use direct rendering
avcodec debug: ffmpeg codec (H264 - MPEG-4 AVC (part 10)) started
main debug: using decoder module "avcodec"
main debug: TIMER module_need() : 1.628 ms - Total 1.628 ms / 1 intvls (Avg 1.628 ms)
main debug: looking for packetizer module: 21 candidates
packetizer_h264 debug: found NAL_SPS (sps_id=0)
packetizer_h264 debug: found NAL_PPS (pps_id=0 sps_id=0)
main debug: using packetizer module "packetizer_h264"
main debug: TIMER module_need() : 0.289 ms - Total 0.289 ms / 1 intvls (Avg 0.289 ms)
main debug: thread (decoder) created at priority 0 (input/decoder.c:301)
main debug: thread started
main debug: looking for meta reader module: 2 candidates
lua debug: Trying Lua scripts in /Users/fiona/Library/Application Support/org.videolan.vlc/lua/meta/reader
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/lua/meta/reader
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/reader/filename.lua
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/share/lua/meta/reader
main debug: no meta reader module matching "any" could be loaded
main debug: TIMER module_need() : 1.759 ms - Total 1.759 ms / 1 intvls (Avg 1.759 ms)
main debug: `<removed>' successfully opened
main debug: TIMER input launching for '<removed>' : 688.566 ms - Total 688.566 ms / 1 intvls (Avg 688.566 ms)
live555 debug: tk->rtpSource->hasBeenSynchronizedUsingRTCP()
main debug: ES_OUT_RESET_PCR called
main debug: Buffering 0%
main debug: Buffering 41%
main debug: Buffering 41%
main debug: Buffering 41%
main debug: Buffering 41%
main debug: Buffering 83%
main debug: no usable vout present, spawning one
main debug: looking for text renderer module: 3 candidates
main debug: using text renderer module "quartztext"
main debug: TIMER module_need() : 0.361 ms - Total 0.361 ms / 1 intvls (Avg 0.361 ms)
main debug: looking for video filter2 module: 15 candidates
swscale debug: 32x32 chroma: YUVA -> 16x16 chroma: YUVA with scaling using Bicubic (good quality)
main debug: using video filter2 module "swscale"
main debug: TIMER module_need() : 0.932 ms - Total 0.932 ms / 1 intvls (Avg 0.932 ms)
main debug: looking for video filter2 module: 15 candidates
yuvp debug: YUVP to YUVA converter
main debug: using video filter2 module "yuvp"
main debug: TIMER module_need() : 0.285 ms - Total 0.285 ms / 1 intvls (Avg 0.285 ms)
main debug: window size: 320x240
main debug: Deinterlacing available
main debug: deinterlace 0, mode blend, is_needed 0
main debug: looking for video output module: 2 candidates
main debug: looking for opengl provider module: 2 candidates
macosx debug: display is Quartz Extreme accelerated
main debug: using opengl provider module "macosx"
main debug: TIMER module_need() : 25.530 ms - Total 25.530 ms / 1 intvls (Avg 25.530 ms)
main debug: using video output module "opengl"
main debug: TIMER module_need() : 25.856 ms - Total 25.856 ms / 1 intvls (Avg 25.856 ms)
main debug: got 1 direct buffer(s)
main debug: pic render sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: pic in sz 320x240, of (0,0), vsz 320x240, 4cc I420, sar 1:1, msk r0x0 g0x0 b0x0
main debug: pic out sz 320x240, of (0,0), vsz 320x240, 4cc UYVY, sar 1:1, msk r0x0 g0x0 b0x0
main debug: looking for video filter2 module: 15 candidates
main debug: using video filter2 module "i420_yuy2_sse2"
main debug: TIMER module_need() : 0.376 ms - Total 0.376 ms / 1 intvls (Avg 0.376 ms)
main debug: indirect render, mapping render pictures 0-24 to system pictures 1-25
avcodec debug: using direct rendering
main debug: End of video preroll
main debug: Received first picture
main debug: looking for video blending module: 1 candidate
blend debug: chroma: YUVA -> UYVY
main debug: using video blending module "blend"
main debug: TIMER module_need() : 0.453 ms - Total 0.453 ms / 1 intvls (Avg 0.453 ms)
main debug: Post-processing available
main warning: vlc_object_find_name(postproc) is not safe!
main debug: Stream buffering done (1500 ms in 1401 ms)
main debug: Decoder buffering done in 0 ms
main warning: late picture skipped (300912 > -559)
main warning: late picture skipped (146741 > -192)