[FFmpeg-user] ffmpeg stops randomly with “No more output streams to write to, finishing” when reading rtsp stream

Y. Dong tq00oqi at gmail.com
Thu May 26 06:58:14 CEST 2016


Hello there,

Basically I am running the following ffmpeg command to record an h264 rtsp
stream to a local file, under Ubuntu 14.04 64bit with i7 CPU and 8GB memory:
ffmpeg -v debug -i rtsp://
172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB -codec copy test.mp4
ffmpeg version N-79139-gde1a0d4 Copyright (c) 2000-2016 the FFmpeg
developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.1)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg
--mandir=/usr/share/man --enable-avresample --disable-debug
--enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb
--enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb
--enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264
--enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame
--enable-libopus --enable-libvpx --enable-libspeex --enable-libass
--enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 30.100 / 57. 30.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with
argument 'debug'.
Reading option '-i' ... matched as input file with argument 'rtsp://
172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB'.
Reading option '-codec' ... matched as option 'codec' (codec name) with
argument 'copy'.
Reading option 'test.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file rtsp://
172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB.
Successfully parsed a group of options.
Opening an input file: rtsp://
172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB.
[tcp @ 0x305dca0] No default whitelist set
[rtsp @ 0x305bd40] SDP:
m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=640028;sprop-parameter-sets=Z2QAKKzoBQBbkA==,aO48sA==
a=control:trackID=0
m=audio 0 RTP/AVP 98
a=rtpmap:98 MPEG4-GENERIC/16000/1
a=fmtp:98
profile-level-id=1;mode=AAC-lbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408;cpresent=0;
a=control:trackID=1


[rtsp @ 0x305bd40] video codec set to: h264
[rtsp @ 0x305bd40] RTP Packetization Mode: 1
[rtsp @ 0x305bd40] RTP Profile IDC: 64 Profile IOP: 0 Level: 28
[rtsp @ 0x305bd40] Extradata set to 0x305b830 (size: 22)
[rtsp @ 0x305bd40] audio codec set to: aac
[rtsp @ 0x305bd40] audio samplerate set to: 16000
[rtsp @ 0x305bd40] audio channels set to: 1
[rtp @ 0x305e160] No default whitelist set
[udp @ 0x305e220] No default whitelist set
[udp @ 0x305e220] end receive buffer size reported is 131072
[udp @ 0x30723c0] No default whitelist set
[udp @ 0x30723c0] end receive buffer size reported is 131072
[rtsp @ 0x305bd40] method SETUP failed: 461 Unsupported transport
[rtsp @ 0x305bd40] CSeq: 3

[rtsp @ 0x305bd40] setting jitter buffer size to 0
    Last message repeated 1 times
[rtsp @ 0x305bd40] hello state=0
[rtsp @ 0x305bd40] All info found
[rtsp @ 0x305bd40] rfps: 24.250000 0.017117
[rtsp @ 0x305bd40] rfps: 24.333333 0.012216
[rtsp @ 0x305bd40] rfps: 24.416667 0.008144
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.500000 0.004899
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.583333 0.002482
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.666667 0.000893
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.750000 0.000131
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.833333 0.000197
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 24.916667 0.001091
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 25.000000 0.002813
[rtsp @ 0x305bd40] rfps: 25.000000 0.002812
[rtsp @ 0x305bd40] rfps: 25.083333 0.005362
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 25.166667 0.008739
    Last message repeated 1 times
[rtsp @ 0x305bd40] rfps: 25.250000 0.012944
[rtsp @ 0x305bd40] rfps: 25.333333 0.017976
[rtsp @ 0x305bd40] rfps: 49.000000 0.019597
[rtsp @ 0x305bd40] rfps: 50.000000 0.011250
Input #0, rtsp, from 'rtsp://
172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 28, 1/90000: Video: h264 (High), 1 reference frame,
yuv420p(left), 1280x720, 1/180000, 24.75 tbr, 90k tbn, 180k tbc
    Stream #0:1, 13, 1/16000: Audio: aac (LC), 16000 Hz, mono, fltp
Successfully opened the file.
Parsing a group of options: output file test.mp4.
Applying option codec (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: test.mp4.
[file @ 0x30a9ea0] Setting default whitelist 'file,crypto'
Successfully opened the file.
Output #0, mp4, to 'test.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0, 0, 1/90000: Video: h264, 1 reference frame ([33][0][0][0]
/ 0x0021), yuv420p(left), 1280x720 (0x0), 1/90000, q=2-31, 24.75 tbr, 90k
tbn, 90k tbc
    Stream #0:1, 0, 1/16000: Audio: aac (LC) ([64][0][0][0] / 0x0040),
16000 Hz, mono
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
    Last message repeated 1 times
[mp4 @ 0x31876c0] Timestamps are unset in a packet for stream 0. This is
deprecated and will stop working in the future. Fix your code to set the
timestamps properly
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
    Last message repeated 8 times
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet9 bitrate=
468.1kbits/s speed=1.16x
frame=  458 fps= 25 q=-1.0 size=    1304kB time=00:00:19.24 bitrate=
555.1kbits/s speed=1.07x [rtsp @ 0x305bd40] Too short data for FU-A H264
RTP packet2 bitrate= 782.3kbits/s speed=1.01x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet8 bitrate=
781.6kbits/s speed=1.01x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet4 bitrate=
780.2kbits/s speed=1.01x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet7 bitrate=
794.1kbits/s speed=1.01x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet3 bitrate=
838.3kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet3 bitrate=
848.3kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet6 bitrate=
850.6kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet3 bitrate=
863.8kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet9 bitrate=
868.6kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet2 bitrate=
875.9kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet2 bitrate=
877.8kbits/s speed=   1x
[rtsp @ 0x305bd40] Too short data for FU-A H264 RTP packet5 bitrate=
865.4kbits/s speed=   1x
No more output streams to write to, finishing.e=00:07:00.65 bitrate=
863.7kbits/s speed=0.992x
frame=10003 fps= 24 q=-1.0 Lsize=   44627kB time=00:07:00.65 bitrate=
869.1kbits/s speed=0.992x
video:42734kB audio:1641kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.567951%
Input file #0 (rtsp://172.16.11.125:554/live/ch00_0?token=hQttXvrjSPOcClQB):
  Input stream #0:0 (video): 10003 packets read (43759360 bytes);
  Input stream #0:1 (audio): 6566 packets read (1680846 bytes);
  Total: 16569 packets (45440206 bytes) demuxed
Output file #0 (test.mp4):
  Output stream #0:0 (video): 10003 packets muxed (43759360 bytes);
  Output stream #0:1 (audio): 6566 packets muxed (1680846 bytes);
  Total: 16569 packets (45440206 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x3237c40] Statistics: 60 seeks, 16823 writeouts



The problem is that ffmpeg exits randomly after 5 to 20 minutes. The RTSP
is a live stream so stopping every 5 minute is really not acceptable. In
the ffmpeg log I can't see any noticeable error except "No more output
streams to write to, finishing." near the end. Can someone shed some light
upon this? How can I make ffmpeg run without stopping? Thanks


Eason


More information about the ffmpeg-user mailing list