id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
1980	ffmpeg process hangs with 100% CPU when getting a live rtsp stream (on redhat linux)	muthuk		"Summary of the bug:
ffmpeg process hangs with 100% CPU when getting a live rtsp stream (on redhat linux). This happens when 25 or more such processes are concurrently invoked.
How to reproduce:
On redhat linux (2.6+) launch 25 or more parallel live rtsp stream reads.

Command line is as follows,
/home/lsadm/StressTest/FFmpeg/bin/ffmpeg -i rtsp://xstream-bcast-grinder003:50554/5EErJWzqY7hSRkrUL030_A_QVGA+email.share@yahoo.com-5EErJWzqY7hSRkrUL030_A_QVGA.sdp -timelimit 306 -minrate 70k -maxrate 1400k -map 0 -t 306 -c:v copy -c:a alac -y /home/lsadm/StressTest/Outputs/mediaOutput/RTSP_DownStreamer-97_5EErJWzqY7hSRkrUL030.mov

The generated console (stats) data is,
ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers
  built on Nov 12 2012 13:10:29 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-44)
  configuration: --disable-yasm --enable-nonfree --prefix=/home/lsadm/StressTest/FFmpeg/
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
[h264 @ 0x17d6f540] Missing reference picture
[h264 @ 0x17d6f540] decode_slice_header error
[h264 @ 0x17d6f540] concealing 300 DC, 300 AC, 300 MV errors in P frame
[h264 @ 0x17d6f540] Missing reference picture
[h264 @ 0x17d6f540] RTP: missed 15429 packets
[h264 @ 0x17d6f540] RTP: missed 15430 packets
[h264 @ 0x17d6f540] RTP: missed 15431 packets
[h264 @ 0x17d6f540] RTP: missed 15432 packets
[h264 @ 0x17d6f540] RTP: missed 15433 packets



Below is a snapshot of the CPU captured with top command,
Tasks: 404 total,   2 running, 402 sleeping,   0 stopped,   0 zombie
Cpu(s):  6.3%us,  0.1%sy,  0.0%ni, 93.4%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   6096740k total,  5990044k used,   106696k free,    10404k buffers
Swap:  1020116k total,   336084k used,   684032k free,  3099316k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                         
22478 lsadm     25   0 27364 4732 1920 R 99.9  0.1  18:35.66 ffmpeg                                                                                          
16383 lsadm     15   0 2695m 2.3g 2624 S  0.7 40.4  32:52.16 perl                                                                                            
26991 lsadm     15   0 29340 6272 2776 S  0.3  0.1   0:00.73 ffmpeg                                                                                          
26994 lsadm     15   0 28192 4904 2416 S  0.3  0.1   0:00.78 ffmpeg                                                                                          
27319 lsadm     15   0 10988 1280  772 R  0.3  0.0   0:00.07 top                                                                                             
    1 root      15   0 10344   80   48 S  0.0  0.0   3:56.92 init       


[lsadm@grinder025 Scripts]$ ps -aef | grep 22478
lsadm    22478 22476 99 17:30 pts/1    00:28:54 /home/lsadm/StressTest/FFmpeg/bin/ffmpeg -i rtsp://xstream-bcast-grinder003:50554/5EErJWzqY7hSRkrUL030_A_QVGA+email.share@yahoo.com-5EErJWzqY7hSRkrUL030_A_QVGA.sdp -timelimit 306 -minrate 70k -maxrate 1400k -map 0 -t 306 -c:v copy -c:a alac -y /home/lsadm/StressTest/Outputs/mediaOutput/RTSP_DownStreamer-97_5EErJWzqY7hSRkrUL030.mov
lsadm    29402  2890  0 17:59 pts/3    00:00:00 grep 22478
[lsadm@grinder025 Scripts]$ ps -aef | grep 22476
lsadm    22476 16383  0 17:30 pts/1    00:00:00 sh -c /home/lsadm/StressTest/FFmpeg/bin/ffmpeg -i 'rtsp://xstream-bcast-grinder003:50554/5EErJWzqY7hSRkrUL030_A_QVGA+email.share@yahoo.com-5EErJWzqY7hSRkrUL030_A_QVGA.sdp' -timelimit 306 -minrate 70k -maxrate 1400k -map 0 -t 306 -c:v copy -c:a alac -y /home/lsadm/StressTest/Outputs/mediaOutput/RTSP_DownStreamer-97_5EErJWzqY7hSRkrUL030.mov 2> /home/lsadm/StressTest/Outputs/openRTSPLog/RTSP_DownStreamer-97_5EErJWzqY7hSRkrUL030.log"	defect	closed	normal	undetermined	1.0	needs_more_info	rtsp	person79@…			0	0
