Anpviz IPC-D250 SDP won't parse
scottlamb opened this issue · 0 comments
scottlamb commented
scottlamb/moonfire-nvr#151 (comment)
This currently produces the error Unable to parse SDP: SdpInvalidSyntax: a=
(using the sdp
crate parser). Similarly, the sdp-types
parser says Unable to parse SDP: Unexpected line 5 starting with 'a'
. (Note that 5 is apparently a 0-indexed line number.)
hex dump:
Length: 827 (0x33b) bytes
0000: 76 3d 30 0d 0a 6f 3d 2d 20 31 31 30 39 31 36 32 v=0..o=- 1109162
0010: 30 31 34 32 31 39 31 38 32 20 31 31 30 39 31 36 014219182 110916
0020: 32 30 31 34 32 31 39 31 39 32 20 49 4e 20 49 50 2014219192 IN IP
0030: 34 20 78 2e 79 2e 7a 2e 77 0d 0a 73 3d 52 54 53 4 x.y.z.w..s=RTS
0040: 50 2f 52 54 50 20 73 74 72 65 61 6d 20 66 72 6f P/RTP stream fro
0050: 6d 20 61 6e 6a 76 69 73 69 6f 6e 20 69 70 63 61 m anjvision ipca
0060: 6d 65 72 61 0d 0a 65 3d 4e 4f 4e 45 0d 0a 63 3d mera..e=NONE..c=
0070: 49 4e 20 49 50 34 20 30 2e 30 2e 30 2e 30 0d 0a IN IP4 0.0.0.0..
0080: 61 3d 74 6f 6f 6c 3a 4c 49 56 45 35 35 35 20 53 a=tool:LIVE555 S
0090: 74 72 65 61 6d 69 6e 67 20 4d 65 64 69 61 20 76 treaming Media v
00a0: 32 30 31 31 2e 30 35 2e 32 35 20 43 48 41 4d 2e 2011.05.25 CHAM.
00b0: 4c 49 40 41 4e 4a 56 49 53 49 4f 4e 2e 43 4f 4d LI@ANJVISION.COM
00c0: 0d 0a 74 3d 30 20 30 0d 0a 61 3d 72 61 6e 67 65 ..t=0 0..a=range
00d0: 3a 6e 70 74 3d 30 2d 0d 0a 61 3d 63 6f 6e 74 72 :npt=0-..a=contr
00e0: 6f 6c 3a 2a 0d 0a 6d 3d 76 69 64 65 6f 20 30 20 ol:*..m=video 0
00f0: 52 54 50 2f 41 56 50 20 39 36 0d 0a 61 3d 72 74 RTP/AVP 96..a=rt
0100: 70 6d 61 70 3a 39 36 20 48 32 36 34 2f 39 30 30 pmap:96 H264/900
0110: 30 30 0d 0a 61 3d 63 6f 6e 74 72 6f 6c 3a 74 72 00..a=control:tr
0120: 61 63 6b 49 44 3d 31 0d 0a 61 3d 66 6d 74 70 3a ackID=1..a=fmtp:
0130: 39 36 20 70 72 6f 66 69 6c 65 2d 6c 65 76 65 6c 96 profile-level
0140: 2d 69 64 3d 34 44 34 30 31 46 3b 70 61 63 6b 65 -id=4D401F;packe
0150: 74 69 7a 61 74 69 6f 6e 2d 6d 6f 64 65 3d 30 3b tization-mode=0;
0160: 73 70 72 6f 70 2d 70 61 72 61 6d 65 74 65 72 2d sprop-parameter-
0170: 73 65 74 73 3d 5a 30 31 41 48 35 57 67 4c 41 53 sets=Z01AH5WgLAS
0180: 61 62 41 51 3d 2c 61 4f 34 38 67 41 3d 3d 3b 63 abAQ=,aO48gA==;c
0190: 6f 6e 66 69 67 3d 30 30 30 30 30 30 30 31 36 37 onfig=0000000167
01a0: 34 64 34 30 31 66 39 35 61 30 32 63 30 34 39 61 4d401f95a02c049a
01b0: 36 63 30 34 30 30 30 30 30 30 30 31 36 38 65 65 6c040000000168ee
01c0: 33 63 38 30 30 30 30 30 30 30 30 31 30 36 66 30 3c800000000106f0
01d0: 32 63 30 34 34 35 63 36 66 35 30 30 30 36 32 30 2c0445c6f5000620
01e0: 65 62 63 32 66 33 66 37 36 33 39 65 34 38 32 35 ebc2f3f7639e4825
01f0: 30 62 66 63 62 35 36 31 62 62 32 62 38 35 64 64 0bfcb561bb2b85dd
0200: 61 36 66 65 35 66 30 36 63 63 38 62 38 38 37 62 a6fe5f06cc8b887b
0210: 36 61 39 31 35 66 35 61 61 33 62 65 62 66 66 66 6a915f5aa3bebfff
0220: 66 66 66 66 66 66 66 66 37 33 38 30 0d 0a 61 3d ffffffff7380..a=
0230: 78 2d 64 69 6d 65 6e 73 69 6f 6e 73 3a 20 37 30 x-dimensions: 70
0240: 34 2c 20 35 37 36 0d 0a 61 3d 78 2d 66 72 61 6d 4, 576..a=x-fram
0250: 65 72 61 74 65 3a 20 31 32 0d 0a 6d 3d 61 75 64 erate: 12..m=aud
0260: 69 6f 20 30 20 52 54 50 2f 41 56 50 20 30 0d 0a io 0 RTP/AVP 0..
0270: 61 3d 72 74 70 6d 61 70 3a 30 20 4d 50 45 47 34 a=rtpmap:0 MPEG4
0280: 2d 47 45 4e 45 52 49 43 2f 31 36 30 30 30 2f 32 -GENERIC/16000/2
0290: 0d 0a 61 3d 66 6d 74 70 3a 30 20 63 6f 6e 66 69 ..a=fmtp:0 confi
02a0: 67 3d 31 34 30 38 0d 0a 61 3d 63 6f 6e 74 72 6f g=1408..a=contro
02b0: 6c 3a 74 72 61 63 6b 49 44 3d 32 0d 0a 61 3d 4d l:trackID=2..a=M
02c0: 65 64 69 61 5f 68 65 61 64 65 72 3a 4d 45 44 49 edia_header:MEDI
02d0: 41 49 4e 46 4f 3d 34 39 34 44 34 42 34 38 30 31 AINFO=494D4B4801
02e0: 30 31 30 30 30 30 30 34 30 30 30 31 30 30 31 30 0100000400010010
02f0: 37 31 30 31 31 30 34 30 31 46 30 30 30 30 30 30 710110401F000000
0300: 46 41 30 30 30 30 30 30 30 30 30 30 30 30 30 30 FA00000000000000
0310: 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
0320: 30 30 30 30 30 30 3b 0d 0a 61 3d 61 70 70 76 65 000000;..a=appve
0330: 72 73 69 6f 6e 3a 31 2e 30 0d 0a rsion:1.0..
raw:
v=0
o=- 1109162014219182 1109162014219192 IN IP4 x.y.z.w
s=RTSP/RTP stream from anjvision ipcamera
e=NONE
c=IN IP4 0.0.0.0
a=tool:LIVE555 Streaming Media v2011.05.25 CHAM.LI@ANJVISION.COM
t=0 0
a=range:npt=0-
a=control:*
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=control:trackID=1
a=fmtp:96 profile-level-id=4D401F;packetization-mode=0;sprop-parameter-sets=Z01AH5WgLASabAQ=,aO48gA==;config=00000001674d401f95a02c049a6c040000000168ee3c800000000106f02c0445c6f5000620ebc2f3f7639e48250bfcb561bb2b85dda6fe5f06cc8b887b6a915f5aa3bebfffffffffff7380
a=x-dimensions: 704, 576
a=x-framerate: 12
m=audio 0 RTP/AVP 0
a=rtpmap:0 MPEG4-GENERIC/16000/2
a=fmtp:0 config=1408
a=control:trackID=2
a=Media_header:MEDIAINFO=494D4B48010100000400010010710110401F000000FA000000000000000000000000000000000000;
a=appversion:1.0
Looks like the error is that there's an a=
line between c=
and t=
. The a=
has to be after the t=
, according to the grammar in RFC 8866 section 9:
; SDP Syntax
session-description = version-field
origin-field
session-name-field
[information-field]
[uri-field]
*email-field
*phone-field
[connection-field]
*bandwidth-field
1*time-description
[key-field]
*attribute-field
*media-description
I've been thinking of switching to sdp-types
(to minimize the number of different authors in Retina's dependency list), so I'll file an issue there and see if its author is amenable to making the parser more forgiving.