GNOME Bugzilla – Bug 745964
decoding failure for h264 over rtsp
Last modified: 2015-03-10 13:51:14 UTC
Linux Debian 7.4, 64bit, gstreamer 0.10.36 I have a program on remote server which reads stream from many cameras and it worked just fine until now - we added 4 new cameras (new model) and gstreamer pipeline for that camera model works fine for a few minutes (2-30) and then it suddenly stops and starts consuming 100% CPU. Other camera's (different models) pipelines are fine. I'm able to reproduce it from commandline using this pipeline (executed on the server): $ GST_DEBUG=3 gst-launch rtspsrc location=rtsp://XX:YY ! decodebin ! fakesink The stream is h264, 352x288, ~12fps It's very unpredictable and when I try to reproduce it, it never does the same thing twice. But here is list of all clues that I was able to get: 1) it never happens immediately. On some cameras, it happens sooner (2-5minutes), on others it take days to manifest 2) in log there is allways this message: ffmpeg :0:: decode_slice_header error 3) after this error message, it looks fine for 2-3 minutes, and then the stream stops and gst-launch process starts consuming 100% CPU (it was ~1% before) I was not able to reproduce this problem on my desktop using the same gst-launch pipeline (I'm able to acces the cameras via VPN). On my dektop I have debian 6, 64bit, gstreamer 0.10.30 - but with manually rebuilded gst-plugin-ffmpeg using it's own copy of ffmpeg. Here are some examples from the logs before the problem starts (I do not post one log, as it is allways different) which I think may be relevant: ----------------------------------------------------------------- WARN codecparsers_h264 gsth264parser.c:1646:gst_h264_parse_pps: value not in allowed range. value: 52, range -12-12 WARN codecparsers_h264 gsth264parser.c:1686:gst_h264_parse_pps: error parsing "Picture parameter set" WARN codecparsers_h264 gsth264parser.c:1646:gst_h264_parse_pps: value not in allowed range. value: 52, range -12-12 WARN codecparsers_h264 gsth264parser.c:1686:gst_h264_parse_pps: error parsing "Picture parameter set" ERROR ffmpeg :0:: cabac_init_idc overflow ERROR ffmpeg :0:: decode_slice_header error INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: illegal memory management control operation 29 ERROR ffmpeg :0:: error while decoding MB 9 0, bytestream (-8) INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: Missing reference picture ERROR ffmpeg :0:: error while decoding MB 1 0, bytestream (-21) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: error while decoding MB 9 0, bytestream (-3) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: illegal reordering_of_pic_nums_idc ERROR ffmpeg :0:: decode_slice_header error ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: error while decoding MB 7 0, bytestream (-5) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: illegal reordering_of_pic_nums_idc ERROR ffmpeg :0:: decode_slice_header error ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: illegal reordering_of_pic_nums_idc ERROR ffmpeg :0:: decode_slice_header error ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: error while decoding MB 3 0, bytestream (-12) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: error while decoding MB 2 0, bytestream (-14) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors ERROR ffmpeg :0:: error while decoding MB 0 0, bytestream (-23) ERROR ffmpeg :0:: number of reference frames (0+3) exceeds max (1; probably corrupt input), discarding one INFO ffmpeg :0:: concealing 396 DC, 396 AC, 396 MV errors WARN codecparsers_h264 gsth264parser.c:1756:gst_h264_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 1 ERROR ffmpeg :0:: non-existing PPS 1 referenced ERROR ffmpeg :0:: decode_slice_header error ERROR ffmpeg :0:: Changing field mode (3 -> 3) between slices is not allowed ERROR ffmpeg :0:: decode_slice_header error ERROR ffmpeg :0:: non-existing SPS 1 referenced in buffering period WARN ffmpeg gstffmpegdec.c:2299:gst_ffmpegdec_frame:<ffdec_mpeg40> ffdec_mpeg4: decoding error (len: -1, have_data: 0) WARN codecparsers_mpeg4 gstmpeg4parser.c:184:parse_quant: failed to read uint8, nbits: 8 WARN codecparsers_mpeg4 gstmpeg4parser.c:199:parse_quant: failed parsing quant matrix WARN codecparsers_mpeg4 gstmpeg4parser.c:1198:gst_mpeg4_parse_video_object_layer: failed parsing "Video Object Layer" ERROR ffmpeg :0:: header damaged WARN ffmpeg gstffmpegdec.c:2299:gst_ffmpegdec_frame:<ffdec_mpeg40> ffdec_mpeg4: decoding error (len: -1, have_data: 0)
Thanks for the bug report, but GStreamer 0.10.x is no longer maintained. Could you try with a recent 1.x version please?
Oh, I didn't knew that... Unfortunately I can't - installing anything on that server is a big problem. The server can't connect to anything outside it's local network (probably because of security reasons) and since it's debian, I don't want to "pollute" it with manually compilled and installed software.. Ok, I guess I have to find some workaround.
I think you can get 1.2 or 1.4 from debian backports.
I just can't do that on production server. Not only I don't have internet connectivity there, but also I can't risk breaking other things that work right now, because I don't know if the 1.x version is 100% backward compatible and even if I thought I knew, it would still be impossible on production server :(