[Ffmpeg-devel] RTSP with Axis 213 camera

Michael A. Kohn mike
Tue Apr 11 21:06:20 CEST 2006

hi all..

I'm having trouble with ffmpeg doing an RTSP stream from an Axis 213
camera.  I've been playing around with the source code trying to fix it
myself, but I think I'm finally stuck.

The problem:  ffplay can connect to this camera and displays video
perfectly for exactly 1 minute.  After 1 minute it hangs.

Test platforms: Linux 2.6.14-gentoo-r2 AMD 64
                Darwin 7.x - Pentium 4

When playing the video using mplayer, it works perfectly.  I realize
mplayer has different RTSP code so I did a TCP dump to try and figure out
what's  wrong.  It looks like there are RTCP packets that get sent back
and forth between mplayer and the camera.  The camera sends 60 bytes every
3 seconds or so and mplayer sends 56 bytes.  When connecting with ffmpeg
the camera sends 60 bytes, but ffmpeg doesn't send the 56 bytes back.

TCPdump using MPlayer of the RTCP packets:

13:43:14.469879 IP > UDP,
length 60
        0x0000:  4500 0058 0000 4000 4011 f09d c0a8 6490
        0x0010:  c0a8 6416 c403 8075 0044 b11f 80c8 0006
        0x0020:  60a9 d455 83b7 ed6f 9e9e 7271 7858 8a95
        0x0030:  0000 166c 0070 35aa 81ca 0007 60a9 d455
        0x0040:  0114 726f 6f74 4031 3932 2e31 3638 2e31
        0x0050:  3030

13:43:16.757706 IP > UDP,
length 56
        0x0000:  4500 0054 000a 4000 4011 f097 c0a8 6416
        0x0010:  c0a8 6490 8075 c403 0040 4a49 81c9 0007
        0x0020:  4e33 b2b9 60a9 d455 0000 0000 0000 3393
        0x0030:  0000 008b ed6f 9e9e 0002 49a9 81ca 0005
        0x0040:  4e33 b2b9 010c 7375 7065 722d 6b6e 756c
        0x0050:  6c61

Breaking down these packets from rfc1889 section 6:

from camera to mplayer starting at 80c8 this should be an SR (sender
report) packet:

version: 2
reception report count: 0
packet type: 200
length: 6 + 1 (32 bit words)
SSRC: 60a9 d455
NTP timestamp: 83b7 ed6f 9e9e 7271
RTP timestamp: 7858 8a95
sender packet count: 0000 166c
sender octet count: 0070 35aa

version: 2
report count: 1
packet type: 202
length: 7 + 1 (32 bit words)
SSRC: 60a9 d455
LENGTH: 0x14
text: root at 192.168... etc

>From mplayer to the camera:

version: 2
report count: 1
packet type: 201 (rr)
length: 7 + 1 (32 bit words)
ssrc: 4e33 b2b9
ssrc_1: 60a9 d455
fraction lost: 0
cumulative packets lost: 0
highest seq received: 0000 3393
interarrival jitter: 0000 008b
last SR: ed6f 9e9e
delay since last sr: 0002 49a9

and then CNAME follows again just like it does for the SS

The last piece of info I have... when ffmpeg connects to the camera
with TCP connect, the Transport header comes back as:
for example.

I tried modifying rtpproto.c in the function rtp_read() it would send 56
bytes of data to the camera every time an SS packet comes in from the
camera to let it know it was alive.. to try and keep the camera sending
data, but I didn't know what to put for the values ssrc, jitter, last sr,
and delay since last sr.. so I put something I thought looked right..
anyway, it obviously doesn't work.. :)

Anyway, has anyone seen this also and is anyone working on it or can give
me any clues how to fix it?



More information about the ffmpeg-devel mailing list