Intermittent failure of stream recording

Steam recording with RTMPDump or FFmpeg.
Post Reply
Jeremy6158
Posts: 1
Joined: Sun Jan 14, 2018 2:37 pm

Intermittent failure of stream recording

Post by Jeremy6158 » Sun Jan 14, 2018 2:47 pm

I have a few scripts that I've been using for recording some cameras with RTSP streams on a schedule. It has worked great for many months but now I'm getting some intermittent failures of these cameras / encoders. In troubleshooting I updated the firmware of the encoders I was having issues with and it didn't help. I then updated my FFMpeg install to the latest (I'm on windows) and still no luck. Anyone have an idea what could be the issue? From what I can tell from the debug logs is that it is listening to the stream to figure out what kind of video it is and the framerate, and sometimes it doesn't get them and gives up. I've spent many hours trying different things but no luck. The most recent change was adding -probesize and -analyzeduration options but that didn't help. You'll find this in the log below

Code: Select all

 [rtsp @ 00000000006348c0] decoding for stream 0 failed

Code: Select all

ffmpeg started on 2018-01-13 at 16:55:05
Report written to "ffmpeg-20180113-165505.log"
Command line:
"C:\\ffmpeg\\bin\\ffmpeg.exe" -loglevel debug -report -probesize 10M -analyzeduration 15000000 -rtbufsize 15000000 -rtsp_transport tcp -y -i rtsp://10.10.105.163/main -t 5400 -c:v copy -c:a copy -movflags faststart "G:\\video\\staging\\TCL_Saturday_01-13-2018_165500_HD.mp4"
ffmpeg version N-89674-g57d0c24132 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-amf --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  3.100 / 58.  3.100
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  8.100 /  7.  8.100
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-probesize' ... matched as AVOption 'probesize' with argument '10M'.
Reading option '-analyzeduration' ... matched as AVOption 'analyzeduration' with argument '15000000'.
Reading option '-rtbufsize' ... matched as AVOption 'rtbufsize' with argument '15000000'.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport' with argument 'tcp'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://10.0.0.10/main'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '5400'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-movflags' ... matched as AVOption 'movflags' with argument 'faststart'.
Reading option 'G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://10.0.0.10/main.
Successfully parsed a group of options.
Opening an input file: rtsp://10.0.0.10/main.
[tcp @ 0000000000638800] No default whitelist set
[rtsp @ 00000000006348c0] SDP:
v=0

o=- 18467 41 IN IP4 0.0.0.0

c=IN IP4 0.0.0.0

a=control:*

a=range:npt=0-

t=0 0

m=video 0 RTP/AVP 96

a=rtpmap:96 H264/90000

a=fmtp:96 profile-level-id=42001f; packetization-mode=2; sprop-parameter-sets=Z0IAH5WoFAFuwFuAgICB,aM48gA==;

a=control:trackID=1

m=audio 0 RTP/AVP 97

a=rtpmap:97 MPEG4-GENERIC/48000/2

a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1190

a=control:trackID=2




Failed to parse interval end specification ''
[rtsp @ 00000000006348c0] video codec set to: h264
[rtsp @ 00000000006348c0] RTP Profile IDC: 42 Profile IOP: 0 Level: 1f
[rtsp @ 00000000006348c0] RTP Packetization Mode: 2
[rtsp @ 00000000006348c0] Interleaved RTP mode is not supported yet.
[rtsp @ 00000000006348c0] Extradata set to 0000000000635140 (size: 27)
[rtsp @ 00000000006348c0] audio codec set to: aac
[rtsp @ 00000000006348c0] audio samplerate set to: 48000
[rtsp @ 00000000006348c0] audio channels set to: 2
[rtsp @ 00000000006348c0] setting jitter buffer size to 0
[rtsp @ 00000000006348c0] setting jitter buffer size to 0
[rtsp @ 00000000006348c0] hello state=0
[h264 @ 0000000000639e00] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] Format yuvj420p chosen by get_format().
[h264 @ 0000000000639e00] Reinit context to 1280x720, pix_fmt: yuvj420p
[h264 @ 0000000000639e00] Frame num gap 23 21
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[h264 @ 0000000000639e00] nal_unit_type: 1, nal_ref_idc: 3
[rtsp @ 00000000006348c0] decoding for stream 0 failed
Input #0, rtsp, from 'rtsp://10.0.0.10/main':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 28, 1/90000: Video: h264 (Baseline), 1 reference frame, yuvj420p(pc, bt709, progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 0/1, 90k tbr, 90k tbn, 180k tbc
    Stream #0:1, 44, 1/48000: Audio: aac (LC), 48000 Hz, stereo, fltp
Successfully opened the file.
Parsing a group of options: output url G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 5400.
Applying option c:v (codec name) with argument copy.
Applying option c:a (codec name) with argument copy.
Successfully parsed a group of options.
Opening an output file: G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4.
[file @ 00000000006c2280] Setting default whitelist 'file,crypto'
Successfully opened the file.
Output #0, mp4, to 'G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4':
  Metadata:
    encoder         : Lavf58.3.100
    Stream #0:0, 0, 1/90000: Video: h264 (Baseline), 1 reference frame (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive, left), 1280x720 (0x0) [SAR 1:1 DAR 16:9], 0/1, q=2-31, 90k tbr, 90k tbn, 90k tbc
    Stream #0:1, 0, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
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)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
No more output streams to write to, finishing.
[mp4 @ 0000000001fd94c0] Starting second pass: moving the moov atom to the beginning of the file
[mp4 @ 0000000001fd94c0] Opening 'G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4' for reading
[file @ 0000000000631540] Setting default whitelist 'file,crypto'
[AVIOContext @ 00000000006b9dc0] Statistics: 10991 bytes read, 0 seeks
frame=    0 fps=0.0 q=-1.0 Lsize=      12kB time=00:00:00.91 bitrate= 106.9kbits/s speed= 8.4x    
video:0kB audio:11kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 12.053368%
Input file #0 (rtsp://10.0.0.10/main):
  Input stream #0:0 (video): 28 packets read (300709 bytes); 
  Input stream #0:1 (audio): 44 packets read (10943 bytes); 
  Total: 72 packets (311652 bytes) demuxed
Output file #0 (G:\video\staging\TCL_Saturday_01-13-2018_165500_HD.mp4):
  Output stream #0:0 (video): 0 packets muxed (0 bytes); 
  Output stream #0:1 (audio): 44 packets muxed (10943 bytes); 
  Total: 44 packets (10943 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 000000000068c540] Statistics: 4 seeks, 5 writeouts

Post Reply