[Libav-user] Sunba H264 camera
Len Day
led at lenday.com
Wed Nov 30 07:35:35 EET 2016
Hi,
I'm trying to capture the H264 stream from a Sunba security camera via
RTSP. I've been working on this for some time and there are some issues
with the video stream but I'd like to crack it. I'm fairly new to the
internals of video. The manufacturer provides a Windows program that
will play the stream so the info is there. VLC won't play the stream,
it appears to get one frame and no more.
I found an example program (from 2012) here:
http://stackoverflow.com/questions/9251747/record-rtsp-stream-with-ffmpeg-libavformat
It does exactly what I need to do on the input side but it's not working
with this camera, I thought someone might have a suggestion or at least
be able to comment on what's wrong with the stream. It sets log level to
debug.
The call to avformat_open_input displays:
[tcp @ 0x248c1f0] No default whitelist set
[rtsp @ 0x248a3e0] SDP:
v=0
o=- 38990265062388 38990265062388 IN IP4 192.168.1.101
s=RTSP Session
c=IN IP4 192.168.1.101
t=0 0
a=control:*
a=range:npt=0-
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=range:npt=0-
a=framerate:0S
a=fmtp:96 profile-level-id=4d001f; packetization-mode=1;
sprop-parameter-sets=Z00AH5WoFAFuhAAAAwAEAAADAAoQ,aO48gA==
a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;
a=framerate:25
a=control:trackID=1
Failed to parse interval end specification ''
[rtsp @ 0x248a3e0] video codec set to: h264
Failed to parse interval end specification ''
[rtsp @ 0x248a3e0] RTP Profile IDC: 4d Profile IOP: 0 Level: 1f
[rtsp @ 0x248a3e0] RTP Packetization Mode: 1
[rtsp @ 0x248a3e0] Extradata set to 0x248d5f8 (size: 33)
[rtp @ 0x248c380] No default whitelist set
[udp @ 0x248d910] No default whitelist set
[udp @ 0x248d910] end receive buffer size reported is 131072
[udp @ 0x248d850] No default whitelist set
[udp @ 0x248d850] end receive buffer size reported is 131072
[rtsp @ 0x248a3e0] setting jitter buffer size to 500
[rtsp @ 0x248a3e0] hello state=0
avformat_find_stream_info displays:
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x248d150] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] nal_unit_type: 1, nal_ref_idc: 3
[rtsp @ 0x248a3e0] max delay reached. need to consume packet
[rtsp @ 0x248a3e0] RTP: missed 23 packets
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x248d150] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] bytestream overread -3
[h264 @ 0x248d150] bytestream overread -13
[h264 @ 0x248d150] error while decoding MB 39 32, bytestream -13
[h264 @ 0x248d150] concealing 1050 DC, 1050 AC, 1050 MV errors in I frame
[h264 @ 0x248d150] nal_unit_type: 1, nal_ref_idc: 3
[rtsp @ 0x248a3e0] max delay reached. need to consume packet
[rtsp @ 0x248a3e0] RTP: missed 23 packets
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x248d150] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] bytestream overread -13
[h264 @ 0x248d150] error while decoding MB 18 32, bytestream -13
[h264 @ 0x248d150] concealing 1071 DC, 1071 AC, 1071 MV errors in I frame
[h264 @ 0x248d150] nal_unit_type: 1, nal_ref_idc: 3
[rtsp @ 0x248a3e0] max delay reached. need to consume packet
[rtsp @ 0x248a3e0] RTP: missed 31 packets
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x248d150] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x248d150] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x248d150] unknown SEI type 229
[h264 @ 0x248d150] bytestream overread -17
[h264 @ 0x248d150] error while decoding MB 35 29, bytestream -17
[h264 @ 0x248d150] concealing 1294 DC, 1294 AC, 1294 MV errors in I frame
[rtsp @ 0x248a3e0] max_analyze_duration 5000000 reached at 5000000
microseconds st:0
There's a call to avformat_write_header later which seg faults. BTW, I
think based on what I see with wireshark it is not actually missing the
packets it reports as missing.
I'm using a build from source of ffmpeg-3.1.1.tar.bz2 on a raspberry pi
under raspbian.
TIA,
Len
More information about the Libav-user
mailing list