homebridge-camera-ffmpeg icon indicating copy to clipboard operation
homebridge-camera-ffmpeg copied to clipboard

No Camera Streams Since Move from 2.4.6 beta to v3.0.3. Spins But No Stream

Open Wildcat1 opened this issue 3 years ago • 130 comments

Describe The Problem: v3.0.3 - Cameras will not stream. Worked with 2.4.6 beta without issues. Home app spins when selecting camera and live stream doesnt start. 1 camera will work fine but then subsequent cameras will sit and spin and never stream until shows no response. Mix of 4MP and 4K cams, configs the same but regardless still see the issue even when I match the config to the 'working cam'. Again all of these work fine in 2.4.6 beta

To Reproduce: Install v3.0.3 over 2.4.6 beta. No change to config, cameras that worked in 2.4.6 no longer working in v3.0.3 when accessed through Home app on iPad. Specifically spins and never goes live

Logs:

[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] Video stream requested: 1920 x 1080, 30 fps, 802 kbps
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] Starting video stream: native x native, native fps, ??? kbps
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] Stream command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168**.**:554/cam/realmonitor?channel=1&subtype=0 -an -sn -dn -codec:v copy -pix_fmt yuv420p -color_range mpeg -f rawvideo -payload_type 99 -ssrc 2546799 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 3s+EoLdyCw3kQzXtO0BcZC6Z/Cn1MjsPkoJXbZzu srtp://192.168.**.**:51559?rtcpport=51559&pkt_size=752 -vn -sn -dn -codec:a libfdk_aac -profile:a aac_eld -flags +global_header -f null -ar 16k -b:a 24k -ac 1 -payload_type 110 -ssrc 102694 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 7N+tq5wXpxMXJB0P+8CGD20fbj5DtN/2/kmmju9b srtp://192.168.**.**:63294?rtcpport=63294&pkt_size=188 -loglevel level+verbose
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info] ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   built with Apple clang version 11.0.3 (clang-1103.0.32.62)
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   configuration: --enable-videotoolbox --pkgconfigdir=/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/lib/pkgconfig --prefix=/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace --pkg-config-flags=--static --extra-cflags=-I/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/include --extra-ldflags=-L/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libavutil      56. 51.100 / 56. 51.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libavcodec     58. 91.100 / 58. 91.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libavformat    58. 45.100 / 58. 45.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libavdevice    58. 10.100 / 58. 10.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libavfilter     7. 85.100 /  7. 85.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libswscale      5.  7.100 /  5.  7.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libswresample   3.  7.100 /  3.  7.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [info]   libpostproc    55.  7.100 / 55.  7.100
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [tcp @ 0x7fcb52e04580] [verbose] Starting connection attempt to 192.168**.** port 554
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [tcp @ 0x7fcb52e04580] [verbose] Successfully connected to 192.168**.** port 554
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [tcp @ 0x7fcb52f044c0] [verbose] Starting connection attempt to 192.168**.** port 554
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [tcp @ 0x7fcb52f044c0] [verbose] Successfully connected to 192.168**.** port 554
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fcb53008c00] [verbose] SDP:
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] v=0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] o=- 2253419544 2253419544 IN IP4 0.0.0.0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] s=Media Server
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] c=IN IP4 0.0.0.0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] t=0 0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=control:*
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=packetization-supported:DH
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=rtppayload-supported:DH
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=range:npt=now-
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] m=video 0 RTP/AVP 96
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=control:trackID=0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=framerate:30.000000
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=rtpmap:96 H264/90000
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=fmtp:96 packetization-mode=1;profile-level-id=640032;sprop-parameter-sets=Z2QAMqwsaoCoAv6bgoCCoAAAAwAgAAAHkIAA,aO4xshsA
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=recvonly
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] m=audio 0 RTP/AVP 97
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=control:trackID=1
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=rtpmap:97 MPEG4-GENERIC/32000
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1288
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] a=recvonly
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fcb53008c00] [verbose] setting jitter buffer size to 0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fcb53008c00] [verbose] setting jitter buffer size to 0
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] [h264 @ 0x7fcb53808e00] [verbose] Reinit context to 2688x1520, pix_fmt: yuvj420p
[9/4/2020, 3:12:57 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] Input #0, rtsp, from 'rtsp://user:**********@192.168**.**:554/cam/realmonitor?channel=1&subtype=0':
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Metadata:
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera]     title           : Media Server
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Duration: N/A, start: 0.000000, bitrate: N/A
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     Stream #0:0: Video: h264 (High), 1 reference frame, yuvj420p(pc, bt470bg/bt470bg/bt709, progressive, left), 2688x1520, 30 fps, 30 tbr, 90k tbn, 60 tbc
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     Stream #0:1: Audio: aac (LC), 32000 Hz, mono, fltp
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] Output #0, rtp, to 'srtp://192.168.**.**:51559?rtcpport=51559&pkt_size=752':
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Metadata:
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     title           : 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] Media Server
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     encoder         : Lavf58.45.100
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     Stream #0:0: Video: h264 (High), 1 reference frame, yuvj420p(tv, bt470bg/bt470bg/bt709, progressive, left), 2688x1520 (0x0), q=2-31, 30 fps, 30 tbr, 90k tbn, 30 tbc
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] Stream mapping:
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Stream #0:0 -> #0:0 (copy)
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Stream #0:1 -> #1:0 (aac (native) -> aac (libfdk_aac))
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] Press [q] to stop, [?] for help
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [graph_0_in_0_1 @ 0x7fcb52d09100] [verbose] tb:1/32000 samplefmt:fltp samplerate:32000 chlayout:0x4
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [format_out_1_0 @ 0x7fcb52d04d00] [verbose] auto-inserting filter 'auto_resampler_0' between the filter 'Parsed_anull_0' and the filter 'format_out_1_0'
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [auto_resampler_0 @ 0x7fcb52c0f900] [verbose] ch:1 chl:mono fmt:fltp r:32000Hz -> ch:1 chl:mono fmt:s16 r:16000Hz
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] Output #1, rtp, to 'srtp://192.168.**.**:63294?rtcpport=63294&pkt_size=188':
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]   Metadata:
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     title           : Media Server
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     encoder         : Lavf58.45.100
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     Stream #1:0: Audio: aac (libfdk_aac) (ELD), 16000 Hz, mono, s16, delay 288, 24 kb/s
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]     Metadata:
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info]       encoder         : Lavc58.91.100 libfdk_aac
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7fcb54841600] [warning] Non-monotonous DTS in output stream 0:0; previous: 24000, current: 9000; changing to 24000. This may result in incorrect timestamps in the output file.
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7fcb54841600] [warning] Non-monotonous DTS in output stream 0:0; previous: 24000, current: 11970; changing to 24000. This may result in incorrect timestamps in the output file.
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7fcb54841600] [warning] Non-monotonous DTS in output stream 0:0; previous: 24000, current: 15030; changing to 24000. This may result in incorrect timestamps in the output file.
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7fcb54841600] [warning] Non-monotonous DTS in output stream 0:0; previous: 24000, current: 18000; changing to 24000. This may result in incorrect timestamps in the output file.
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7fcb54841600] [warning] Non-monotonous DTS in output stream 0:0; previous: 24000, current: 20970; changing to 24000. This may result in incorrect timestamps in the output file.
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:12:58 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   11 fps=0.0 q=-1.0 size=     864kB time=00:00:00.43 bitrate=16465.9kbits/s speed=0.852x    
[9/4/2020, 3:12:59 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   28 fps= 27 q=-1.0 size=    1605kB time=00:00:00.96 bitrate=13597.3kbits/s speed=0.949x    
[9/4/2020, 3:12:59 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   30 fps= 20 q=-1.0 size=    1696kB time=00:00:01.48 bitrate=9349.4kbits/s speed=0.975x    
[9/4/2020, 3:13:00 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   30 fps= 15 q=-1.0 size=    1696kB time=00:00:01.99 bitrate=6953.5kbits/s speed=0.981x    
[9/4/2020, 3:13:00 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   42 fps= 17 q=-1.0 size=    2707kB time=00:00:02.44 bitrate=9066.0kbits/s speed=0.962x    
[9/4/2020, 3:13:01 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   44 fps= 14 q=-1.0 size=    2801kB time=00:00:03.02 bitrate=7591.2kbits/s speed=0.982x    
[9/4/2020, 3:13:02 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   44 fps= 12 q=-1.0 size=    2801kB time=00:00:03.53 bitrate=6488.0kbits/s speed=0.989x    
[9/4/2020, 3:13:02 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   55 fps= 13 q=-1.0 size=    3302kB time=00:00:04.07 bitrate=6633.9kbits/s speed=0.99x    
[9/4/2020, 3:13:03 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   55 fps= 12 q=-1.0 size=    3302kB time=00:00:04.55 bitrate=5935.3kbits/s speed=0.987x    
[9/4/2020, 3:13:03 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   56 fps= 11 q=-1.0 size=    3347kB time=00:00:05.07 bitrate=5397.9kbits/s speed=0.989x    
[9/4/2020, 3:13:04 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   56 fps=9.9 q=-1.0 size=    3347kB time=00:00:05.59 bitrate=4903.6kbits/s speed=0.992x    
[9/4/2020, 3:13:04 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   57 fps=9.3 q=-1.0 size=    3968kB time=00:00:06.10 bitrate=5320.4kbits/s speed=0.993x    
[9/4/2020, 3:13:05 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   57 fps=8.5 q=-1.0 size=    3968kB time=00:00:06.64 bitrate=4889.8kbits/s speed=0.992x    
[9/4/2020, 3:13:05 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   57 fps=7.9 q=-1.0 size=    3968kB time=00:00:07.15 bitrate=4540.1kbits/s speed=0.994x    
[9/4/2020, 3:13:05 PM] [Camera FFmpeg] [Front Door Camera] Received request to reconfigure: 1280 x 720, 30 fps, 299 kbps (Ignored)
[9/4/2020, 3:13:06 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   58 fps=7.5 q=-1.0 size=    4586kB time=00:00:07.67 bitrate=4895.4kbits/s speed=0.994x    
[9/4/2020, 3:13:06 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   58 fps=7.0 q=-1.0 size=    4586kB time=00:00:08.21 bitrate=4573.6kbits/s speed=0.994x    
[9/4/2020, 3:13:07 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   59 fps=6.7 q=-1.0 size=    5250kB time=00:00:08.72 bitrate=4927.8kbits/s speed=0.993x    
[9/4/2020, 3:13:07 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   59 fps=6.3 q=-1.0 size=    5250kB time=00:00:09.27 bitrate=4638.7kbits/s speed=0.998x    
[9/4/2020, 3:13:08 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   59 fps=6.0 q=-1.0 size=    5250kB time=00:00:09.75 bitrate=4409.0kbits/s speed=0.996x    
[9/4/2020, 3:13:08 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   60 fps=5.8 q=-1.0 size=    5929kB time=00:00:10.27 bitrate=4728.4kbits/s speed=0.995x    
[9/4/2020, 3:13:09 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   60 fps=5.5 q=-1.0 size=    5929kB time=00:00:10.81 bitrate=4493.0kbits/s speed=0.995x    
[9/4/2020, 3:13:09 PM] [Camera FFmpeg] [Front Door Camera] Received request to reconfigure: 640 x 360, 30 fps, 132 kbps (Ignored)
[9/4/2020, 3:13:09 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   61 fps=5.4 q=-1.0 size=    6616kB time=00:00:11.13 bitrate=4868.6kbits/s speed=0.978x    
[9/4/2020, 3:13:10 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   61 fps=5.1 q=-1.0 size=    6616kB time=00:00:11.87 bitrate=4565.9kbits/s speed=0.995x    
[9/4/2020, 3:13:10 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   61 fps=4.9 q=-1.0 size=    6616kB time=00:00:12.37 bitrate=4378.5kbits/s speed=0.996x    
[9/4/2020, 3:13:10 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fcb53008c00] [error] RTP: PT=60: bad cseq 3a7b expected=2234
[9/4/2020, 3:13:10 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:13:11 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   62 fps=4.8 q=-1.0 size=    7313kB time=00:00:12.92 bitrate=4636.1kbits/s speed=0.996x    
[9/4/2020, 3:13:11 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   62 fps=4.6 q=-1.0 size=    7313kB time=00:00:13.43 bitrate=4458.0kbits/s speed=0.997x    
[9/4/2020, 3:13:12 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   75 fps=5.4 q=-1.0 size=    8507kB time=00:00:13.94 bitrate=4997.1kbits/s speed=0.997x    
[9/4/2020, 3:13:12 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   77 fps=5.3 q=-1.0 size=    8594kB time=00:00:14.42 bitrate=4880.3kbits/s speed=0.996x    
[9/4/2020, 3:13:13 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   77 fps=5.1 q=-1.0 size=    8594kB time=00:00:14.94 bitrate=4711.7kbits/s speed=0.997x    
[9/4/2020, 3:13:13 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   90 fps=5.8 q=-1.0 size=    9124kB time=00:00:15.48 bitrate=4826.7kbits/s speed=0.998x    
[9/4/2020, 3:13:14 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   90 fps=5.6 q=-1.0 size=    9124kB time=00:00:15.99 bitrate=4672.3kbits/s speed=0.999x    
[9/4/2020, 3:13:14 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   90 fps=5.4 q=-1.0 size=    9124kB time=00:00:16.47 bitrate=4536.2kbits/s speed=0.997x    
[9/4/2020, 3:13:15 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   91 fps=5.3 q=-1.0 size=    9826kB time=00:00:17.02 bitrate=4728.9kbits/s speed=0.998x    
[9/4/2020, 3:13:15 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   91 fps=5.2 q=-1.0 size=    9826kB time=00:00:17.50 bitrate=4599.2kbits/s speed=0.996x    
[9/4/2020, 3:13:16 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   92 fps=5.1 q=-1.0 size=   10528kB time=00:00:18.01 bitrate=4787.7kbits/s speed=0.997x    
[9/4/2020, 3:13:17 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   92 fps=4.9 q=-1.0 size=   10528kB time=00:00:18.55 bitrate=4647.4kbits/s speed=0.997x    
[9/4/2020, 3:13:17 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   92 fps=4.8 q=-1.0 size=   10528kB time=00:00:19.07 bitrate=4522.6kbits/s speed=0.997x    
[9/4/2020, 3:13:18 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   93 fps=4.7 q=-1.0 size=   11235kB time=00:00:19.58 bitrate=4700.1kbits/s speed=0.998x    
[9/4/2020, 3:13:18 PM] [Camera FFmpeg] [Front Door Camera] [libfdk_aac @ 0x7fcb54846200] [warning] Queue input is backward in time
[9/4/2020, 3:13:18 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:13:18 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   93 fps=4.6 q=-1.0 size=   11235kB time=00:00:20.07 bitrate=4585.4kbits/s speed=0.998x    
[9/4/2020, 3:13:19 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   94 fps=4.5 q=-1.0 size=   11943kB time=00:00:20.55 bitrate=4760.5kbits/s speed=0.994x    
[9/4/2020, 3:13:19 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   94 fps=4.4 q=-1.0 size=   11943kB time=00:00:21.12 bitrate=4630.7kbits/s speed=0.997x    
[9/4/2020, 3:13:20 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   94 fps=4.3 q=-1.0 size=   11943kB time=00:00:21.64 bitrate=4521.1kbits/s speed=0.998x    
[9/4/2020, 3:13:20 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fcb53008c00] [error] RTP: PT=60: bad cseq 6bea expected=56c5
[9/4/2020, 3:13:20 PM] [Camera FFmpeg] [Front Door Camera] 
[9/4/2020, 3:13:20 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   98 fps=4.4 q=-1.0 size=   13249kB time=00:00:22.15 bitrate=4899.6kbits/s speed=0.998x    
[9/4/2020, 3:13:21 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=   98 fps=4.3 q=-1.0 size=   13249kB time=00:00:22.63 bitrate=4795.7kbits/s speed=0.997x    
[9/4/2020, 3:13:21 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  106 fps=4.6 q=-1.0 size=   13479kB time=00:00:23.11 bitrate=4777.7kbits/s speed=0.996x    
[9/4/2020, 3:13:22 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  117 fps=4.9 q=-1.0 size=   13868kB time=00:00:23.68 bitrate=4795.8kbits/s speed=0.998x    
[9/4/2020, 3:13:22 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  117 fps=4.8 q=-1.0 size=   13868kB time=00:00:24.20 bitrate=4693.8kbits/s speed=0.998x    
[9/4/2020, 3:13:23 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  118 fps=4.8 q=-1.0 size=   13904kB time=00:00:24.72 bitrate=4607.6kbits/s speed=0.998x    
[9/4/2020, 3:13:23 PM] [Camera FFmpeg] [Dog Area] Snapshot requested: 1280 x 720
[9/4/2020, 3:13:23 PM] [Camera FFmpeg] [Dog Area] Sending snapshot: 1280 x 720
[9/4/2020, 3:13:23 PM] [Camera FFmpeg] [Dog Area] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168.**.**:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 -
[9/4/2020, 3:13:23 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  118 fps=4.7 q=-1.0 size=   13904kB time=00:00:25.23 bitrate=4514.1kbits/s speed=0.998x    
[9/4/2020, 3:13:24 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  119 fps=4.6 q=-1.0 size=   14696kB time=00:00:25.68 bitrate=4688.1kbits/s speed=0.996x    
[9/4/2020, 3:13:24 PM] [Camera FFmpeg] [Front Door Camera] [info] frame=  119 fps=4.5 q=-1.0 size=   14696kB time=00:00:26.25 bitrate=4585.3kbits/s speed=0.998x    
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Driveway Left Camera] Snapshot requested: 1280 x 720
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Driveway Left Camera] Sending snapshot: 1280 x 720
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Driveway Left Camera] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168.**.**:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 -
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Front Door Camera] Device appears to be inactive. Stopping stream.
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Front Door Camera] Stopped video stream.
[9/4/2020, 3:13:25 PM] [Camera FFmpeg] [Front Door Camera] FFmpeg exited with code: null and signal: SIGKILL (Expected)
[9/4/2020, 3:13:26 PM] [Camera FFmpeg] [Driveway Right] Snapshot requested: 1280 x 720
[9/4/2020, 3:13:26 PM] [Camera FFmpeg] [Driveway Right] Sending snapshot: 1280 x 720
[9/4/2020, 3:13:26 PM] [Camera FFmpeg] [Driveway Right] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168.**.**:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 -
[9/4/2020, 3:13:28 PM] [Camera FFmpeg] [Front Door Camera] Snapshot requested: 1280 x 720
[9/4/2020, 3:13:28 PM] [Camera FFmpeg] [Front Door Camera] Sending snapshot: 1280 x 720
[9/4/2020, 3:13:28 PM] [Camera FFmpeg] [Front Door Camera] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168**.**:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 -
[9/4/2020, 3:13:30 PM] [Camera FFmpeg] [Patio Left Camera] Snapshot requested: 1280 x 720
[9/4/2020, 3:13:30 PM] [Camera FFmpeg] [Patio Left Camera] Sending snapshot: 1280 x 720
[9/4/2020, 3:13:30 PM] [Camera FFmpeg] [Patio Left Camera] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:**********@192.168.**.**:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 -

Environment:

  • Node.js Version:
  • NPM Version:
  • Homebridge Version:
  • Homebridge Camera FFmpeg Version:
  • Homebridge Config UI X Plugin Version:
  • Operating System:

Wildcat1 avatar Sep 04 '20 21:09 Wildcat1

Please share your config. I'll look into it.

Sunoo avatar Sep 04 '20 21:09 Sunoo

Please share your config. I'll look into it.

Thanks for the quick response. I'm running iOS & iPadOS 14 beta and it would appear that part of this may be related to that. iPhone can see the streams albeit with some errors (will post below) BUT iPadOS just sits there as I mentioned above and spins until no response. Both iPhone & iPad on same network, configuration etc so only difference is iOS14 vs iPadOS14.

Having said that, although the phone DOES stream, I am seeing horrendous FPS regardless of setting and bitrate. I do notice this error below when running the stream to some cameras (4MP cams, 2688x1520 res) and once this error occurs it then kills the stream. You can see the FPS it reports below too. Hope this helps

ERROR BEING SEEN ON IPHONE RUNNING IOS14:

[9/4/2020, 4:36:21 PM] [Camera FFmpeg] [Front Door Camera] [rtsp @ 0x7fc86a008c00] [error] RTP: PT=60: bad cseq 2b9a expected=13db [9/4/2020, 4:36:21 PM] [Camera FFmpeg] [Front Door Camera] [9/4/2020, 4:36:21 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 81 fps=7.9 q=-1.0 size= 6712kB time=00:00:10.14 bitrate=5420.7kbits/s speed=0.986x
[9/4/2020, 4:36:22 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 81 fps=7.5 q=-1.0 size= 6712kB time=00:00:10.78 bitrate=5099.5kbits/s speed=0.995x
[9/4/2020, 4:36:22 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 81 fps=7.1 q=-1.0 size= 6712kB time=00:00:11.29 bitrate=4866.6kbits/s speed=0.997x
[9/4/2020, 4:36:23 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 95 fps=8.0 q=-1.0 size= 7962kB time=00:00:11.80 bitrate=5524.8kbits/s speed=0.994x
[9/4/2020, 4:36:23 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 95 fps=7.7 q=-1.0 size= 7962kB time=00:00:12.32 bitrate=5293.5kbits/s speed=0.996x
[9/4/2020, 4:36:24 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 108 fps=8.4 q=-1.0 size= 8472kB time=00:00:12.83 bitrate=5409.5kbits/s speed=0.995x
[9/4/2020, 4:36:25 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 110 fps=8.2 q=-1.0 size= 8552kB time=00:00:13.34 bitrate=5251.1kbits/s speed=0.996x
[9/4/2020, 4:36:25 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 111 fps=8.0 q=-1.0 size= 8602kB time=00:00:13.85 bitrate=5086.5kbits/s speed=0.996x
[9/4/2020, 4:36:26 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 111 fps=7.7 q=-1.0 size= 8602kB time=00:00:14.36 bitrate=4905.2kbits/s speed=0.996x
[9/4/2020, 4:36:26 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 111 fps=7.4 q=-1.0 size= 8602kB time=00:00:14.86 bitrate=4741.2kbits/s speed=0.996x
[9/4/2020, 4:36:27 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 112 fps=7.3 q=-1.0 size= 9313kB time=00:00:15.37 bitrate=4962.4kbits/s speed=0.997x
[9/4/2020, 4:36:27 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 112 fps=7.0 q=-1.0 size= 9313kB time=00:00:15.88 bitrate=4802.5kbits/s speed=0.997x
[9/4/2020, 4:36:28 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 113 fps=6.9 q=-1.0 size= 10024kB time=00:00:16.39 bitrate=5008.0kbits/s speed=0.996x
[9/4/2020, 4:36:28 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 113 fps=6.7 q=-1.0 size= 10024kB time=00:00:16.91 bitrate=4856.0kbits/s speed=0.997x
[9/4/2020, 4:36:29 PM] [Camera FFmpeg] [Front Door Camera] [info] frame= 113 fps=6.5 q=-1.0 size= 10024kB time=00:00:17.42 bitrate=4713.6kbits/s speed=0.998x
[9/4/2020, 4:36:29 PM] [Camera FFmpeg] [Front Door Camera] Device appears to be inactive. Stopping stream. [9/4/2020, 4:36:29 PM] [Camera FFmpeg] [Front Door Camera] Stopped video stream. [9/4/2020, 4:36:29 PM] [Camera FFmpeg] [Front Door Camera] FFmpeg exited with code: null and signal: SIGKILL (Expected)

Wildcat1 avatar Sep 04 '20 22:09 Wildcat1

I still really need to see your config. In particular, are you using interfaceName?

Sunoo avatar Sep 04 '20 22:09 Sunoo

Not using interfaceName no.

Here is a snippet of config for the cam that is having the issue. Was it that section of config you wanted ? I've been doing some more troubleshooting and it appears on this cam that its related to audio. The cams support audio but when I set this one to true thats when I see the errors and thats when it pulls the FPS down and then kills the stream.

I do still see the log entry of [9/4/2020, 4:49:34 PM] [Camera FFmpeg] [Front Door Camera] [rtp @ 0x7f860284f200] [warning] Non-monotonous DTS in output stream 0:0; previous: 5313420, current: 5311170; changing to 5313420. This may result in incorrect timestamps in the output file.

"name": "Camera FFmpeg", "cameras": [ { "name": "Front Door Camera", "motion": true, "doorbell": true, "switches": true, "videoConfig": { "source": "-rtsp_transport http -re -i rtsp://user:**********@192.168..:554/cam/realmonitor?channel=1&subtype=0", "maxWidth": 2688, "maxHeight": 1520, "maxFPS": 15, "maxBitrate": 4096, "vcodec": "copy", "audio": false, "debug": true } }, {

Wildcat1 avatar Sep 04 '20 22:09 Wildcat1

So you’re saying the stream works correctly with audio disabled?

Sunoo avatar Sep 04 '20 22:09 Sunoo

On iOS 14 only (not iPadOS14 nor tvOS14) it plays at full 30FPS without issue WHEN audio is disabled yes. When I turn audio back on (true) then it starts to error and kills the stream. For reference, this didn't happen on 2.4.6 beta where it was able to still hit 30FPS with Audio. The audio stream from the cam itself is AAC 32k.

Some further feedback from testing, tvOS will update the snapshot then just sit and not stream any camera apart from 1 (difference with that cam is that its a 4K cam forced to 1280x720 for reference). On iPadOS, apart from the same cam (forced to 1280x720) the other cams just spin and go non responsive (similarly to tvOS). Again snapshots on tvOS and iPadOS 14 update without issue. Just wanted to provide that extra context as well

Wildcat1 avatar Sep 04 '20 22:09 Wildcat1

Interesting... and I’m not certain I can wrap my head around a set of conditions that would cause that.

In all the logs you’ve shared so far, the stream is being shutdown because Homebridge stops hearing back from whichever device you’re watching the stream on. I could try pushing a beta that increases the amount of time that the plugin waits for a response, but I’m not sure if that’s the cause or not.

Also, can you tell me which version of Homebridge you are running? 1.1.3 had some fixes for cameras, but I don’t think any of it would have impacted what you are seeing.

Sunoo avatar Sep 04 '20 23:09 Sunoo

Same behavior here after update to last version of hb and FFmpeg

martinorob avatar Sep 05 '20 08:09 martinorob

Just rollback to 3.0.2 and it works again stream with audio and still image (hb last version)

npm install -g [email protected]

martinorob avatar Sep 05 '20 08:09 martinorob

Good to know, very little changed between 3.0.2 and 3.0.3, so it shouldn’t be too hard for me to track down the issue.

Sunoo avatar Sep 05 '20 14:09 Sunoo

Very strange.. just update to the last version, hb not showing Webcam. If I go tu the rstp url with vlc, hb start working again..

martinorob avatar Sep 06 '20 13:09 martinorob

Interesting... and I’m not certain I can wrap my head around a set of conditions that would cause that.

In all the logs you’ve shared so far, the stream is being shutdown because Homebridge stops hearing back from whichever device you’re watching the stream on. I could try pushing a beta that increases the amount of time that the plugin waits for a response, but I’m not sure if that’s the cause or not.

Also, can you tell me which version of Homebridge you are running? 1.1.3 had some fixes for cameras, but I don’t think any of it would have impacted what you are seeing.

Running 1.1.3 (about to update to 1.1.6). The weird thing is that both the iPadOS version and tvOS version seem to have the same behavior. Specifically I have 1 cam that seems to work across all OS's without issue and sure enough on the ATV it shows Live in the little tile window and when you click on the cam after about 1-2 seconds its streaming beautifully. However the other cams (that do work on iOS on an iPhone) a) don't update their thumbnails until you scroll past them on ATV and b) when you click may stream once but then not afterwards. Even if 'afterwards' is 5 seconds later

Wildcat1 avatar Sep 08 '20 18:09 Wildcat1

What is also weird is 1 camera that streamed once without issue then now just sits spinning on each re-attempt. Log snip below shows it never moved past the initial connect, no h264 streaming or rtsp lines in error:

[9/8/2020, 12:20:03 PM] [Camera FFmpeg] [Side] Video stream requested: 1280 x 720, 30 fps, 299 kbps [9/8/2020, 12:20:03 PM] [Camera FFmpeg] [Side] Starting video stream: 1280 x 720, 15 fps, ??? kbps [9/8/2020, 12:20:03 PM] [Camera FFmpeg] [Side] Stream command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:@192...:554/cam/realmonitor?channel=1&subtype=0 -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 15 -f rawvideo -preset ultrafast -tune zerolatency -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)2:trunc(ih/2)2 -payload_type 99 -ssrc 12825915 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params S7+GD5N2u8LaGFgBmLlaVHtIxnBDjC/wLeZoyaSS srtp://192...:64478?rtcpport=64478&pkt_size=1316 [9/8/2020, 12:20:30 PM] [Camera FFmpeg] [Side] Snapshot requested: 1280 x 720 [9/8/2020, 12:20:30 PM] [Camera FFmpeg] [Side] Sending snapshot: 1280 x 720 [9/8/2020, 12:20:30 PM] [Camera FFmpeg] [Side] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:*@192...:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 - [9/8/2020, 12:20:32 PM] [Camera FFmpeg] [Side] Device appears to be inactive. Stopping stream. [9/8/2020, 12:20:32 PM] [Camera FFmpeg] [Side] Stopped video stream. [9/8/2020, 12:20:32 PM] [Camera FFmpeg] [Side] FFmpeg exited with code: null and signal: SIGKILL (Expected)

Wildcat1 avatar Sep 08 '20 18:09 Wildcat1

I am experiencing similar issues as well after upgrading HB to 1.1.6 and the plugin to the latest release. Thumbnails are working but can't get any streaming video to work.

awboyd79 avatar Sep 08 '20 21:09 awboyd79

Disclaimer I am no expert in this subject matter but i like to tinker haha.... I found a solution/workaround/temp fix/bandaid?

                "name": "FrontDoor",
                "videoConfig": {
                    "source": "-re -i rtsp://user:password@ip:port/cam/realmonitor?channel=1&subtype=0",
                    "vcodec": "libx264",
                    "encoderOptions": "-ignore_editlist 1 -preset ultrafast"

The issue seems to be the default for ffmpeg encoding -tune zerolatency so by changing encoder options it seem to be working. Note: you don't need the -ignore_editlist 1 this is just my config cause i got crappy camera/connection/Idon'tknowwhy, but i want it to render something over nothing.

lishan89uc avatar Sep 09 '20 08:09 lishan89uc

Interesting that removing the zerolatency tuning resolves this, I’ll have to do some more testing myself and see if I can figure out why that would be. The most recent version of this plugin did pull in a newer version of FFmpeg, maybe it is handling that option differently then before. If I’m able to find a way to recreate this, maybe the best option is to remove that default.

A few people are reporting this issue on this thread, can anyone else confirm if this gets things working for them?

Sunoo avatar Sep 09 '20 14:09 Sunoo

Interesting that removing the zerolatency tuning resolves this, I’ll have to do some more testing myself and see if I can figure out why that would be. The most recent version of this plugin did pull in a newer version of FFmpeg, maybe it is handling that option differently then before. If I’m able to find a way to recreate this, maybe the best option is to remove that default.

A few people are reporting this issue on this thread, can anyone else confirm if this gets things working for them?

Trying this now on all cams and will report back

Wildcat1 avatar Sep 09 '20 17:09 Wildcat1

Which is the config to test? please wrote the config line and i’ll test it

martinorob avatar Sep 09 '20 17:09 martinorob

@martinorob The test would be to add "encoderOptions": "-preset ultrafast" to the videoConfig section of your camera config.

Sunoo avatar Sep 09 '20 17:09 Sunoo

thank you

Il giorno 9 set 2020, alle ore 19:23, David Maher [email protected] ha scritto:

"encoderOptions": "-preset ultrafast"

martinorob avatar Sep 09 '20 17:09 martinorob

my config works without the ultrafast option and doesn’t works with the ultrafast option

i don’t know why

 thank you

Il giorno 9 set 2020, alle ore 19:23, David Maher [email protected] ha scritto:

"encoderOptions": "-preset ultrafast" — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

martinorob avatar Sep 09 '20 17:09 martinorob

Wait, so it’s now working correctly for you without the encoderOptions setting?

Sunoo avatar Sep 09 '20 17:09 Sunoo

yes after last homebridge update

Il giorno 9 set 2020, alle ore 19:40, David Maher [email protected] ha scritto:

 Wait, so it’s now working correctly for you without the encoderOptions setting?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

martinorob avatar Sep 09 '20 17:09 martinorob

Interesting, will have to go look to see what changed in Homebridge between 1.1.3 and 1.1.6.

Sunoo avatar Sep 09 '20 17:09 Sunoo

Mine is still broken the same way even with the -preset ultrafast or without it. Running 1.1.6 as well. Still have 1 cam that works like a charm and the others (even with same config) don't. When testing against an ATV or iPad I see the 1st cam show 'live' then streams within 1-2 seconds, other cams show streaming but are just a snapshot nothing else. 1 final cam will start streaming then stop. Weird thing is like I said, same config, in some cases same cams so not sure why 1 works and others don't. Each OS variant is doing something different so let me try and sum up the OS mess :)

  • iOS / iPhone = Seems to work without issue
  • iPadOS = At times will let you see all streams once but subsequent attempts result in spinning window, no stream but Homebridge / Camera-FFMPEG seems to show streaming 'should' be happening
  • tvOS / ATV = 1 camera streams all the time, 2nd camera streams once then not on subsequent attempts, all other cams show streaming but are actually a snapshot

All OS versions take about 8-10 seconds (apart from the 1 cam) to start streaming (for those that do stream) and in some cases then pause and have another 3-4 seconds before again streaming continually in real-time.

Some further information:

  • My config includes using vcodec = copy (since the streams are already h264 encoded)
  • MaxFPS = 15 on all cam configs
  • MaxBitrate (when set) = 4096
  • MaxWidth & MaxHeight = When set is paired to native resolution, other times not set

Regardless of the config above when trying different combinations (and matching to cam that has no issues) the issues on other cams still persists. Not saying this is all Camera-FFMPEG or even FFMPEG related, I don't doubt that some of this is tvOS 14 related but still something that appears off in this current set of versions.

HTH

Wildcat1 avatar Sep 09 '20 18:09 Wildcat1

@Wildcat1 Are you running the betas on all those devices, or are some still on iOS 13?

Sunoo avatar Sep 09 '20 18:09 Sunoo

Thought I would also post what I see in the logs when trying to play a stream subsequent to a successful one. In other words, successful stream on cam 1 then stop and try to access it again. Then I see the following. This is when pulling the stream through Home app on iPad:

[9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] Starting video stream: native x native, native fps, ??? kbps [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] Stream command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:@192...:554/cam/realmonitor?channel=1&subtype=0 -an -sn -dn -codec:v copy -pix_fmt yuv420p -color_range mpeg -f rawvideo -payload_type 99 -ssrc 2809640 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 0H9WY5F2KVWFOMtM2abvSi3DWltg6az44j6NQVi/ srtp://192...:54502?rtcpport=54502&pkt_size=1316 -loglevel level+verbose [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] built with Apple clang version 11.0.3 (clang-1103.0.32.62) [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] configuration: --enable-videotoolbox --pkgconfigdir=/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/lib/pkgconfig --prefix=/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace --pkg-config-flags=--static --extra-cflags=-I/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/include --extra-ldflags=-L/Users/runner/work/ffmpeg-for-homebridge/ffmpeg-for-homebridge/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libavutil 56. 51.100 / 56. 51.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libavcodec 58. 91.100 / 58. 91.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libavformat 58. 45.100 / 58. 45.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libavdevice 58. 10.100 / 58. 10.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libavfilter 7. 85.100 / 7. 85.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libswscale 5. 7.100 / 5. 7.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libswresample 3. 7.100 / 3. 7.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [info] libpostproc 55. 7.100 / 55. 7.100 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [tcp @ 0x7fe67ad04c00] [verbose] Starting connection attempt to 192...*** port 554 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [tcp @ 0x7fe67ad04c00] [verbose] Successfully connected to 192...*** port 554 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [tcp @ 0x7fe67ae04b40] [verbose] Starting connection attempt to 192...*** port 554 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [tcp @ 0x7fe67ae04b40] [verbose] Successfully connected to 192...*** port 554 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [rtsp @ 0x7fe67b808200] [verbose] SDP: [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] v=0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] o=- 2251991688 2251991688 IN IP4 0.0.0.0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] s=Media Server [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] c=IN IP4 0.0.0.0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] t=0 0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=control:* [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=packetization-supported:DH [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=rtppayload-supported:DH [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=range:npt=now- [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] m=video 0 RTP/AVP 96 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=control:trackID=0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=framerate:25.000000 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=rtpmap:96 H264/90000 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=fmtp:96 packetization-mode=1;profile-level-id=640033;sprop-parameter-sets=J2QAM6wbGqA8AEPEAA==,KO4EYsAA [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] a=recvonly [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [rtsp @ 0x7fe67b808200] [verbose] setting jitter buffer size to 0 [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [h264 @ 0x7fe67b00c600] [verbose] Reinit context to 3840x2160, pix_fmt: yuv420p [9/9/2020, 12:33:24 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [h264 @ 0x7fe67b00c600] [verbose] Increasing reorder buffer to 1 [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Input #0, rtsp, from 'rtsp://user:@192...:554/cam/realmonitor?channel=1&subtype=0': [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Metadata: [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] title : Media Server [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Duration: N/A, start: 0.060000, bitrate: N/A [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Stream #0:0: Video: h264 (High), 1 reference frame, yuv420p(progressive), 3840x2160, 100 tbr, 90k tbn, 180k tbc [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Output #0, rtp, to 'srtp://192...:54502?rtcpport=54502&pkt_size=1316': [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Metadata: [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] title : Media Server [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] encoder : Lavf58.45.100 [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Stream #0:0: Video: h264 (High), 1 reference frame, yuv420p(tv, progressive), 3840x2160 (0x0), q=2-31, 100 tbr, 90k tbn, 90k tbc [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Stream mapping: [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Stream #0:0 -> #0:0 (copy) [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [info] Press [q] to stop, [?] for help [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [rtp @ 0x7fe67b040c00] [warning] 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 [9/9/2020, 12:33:25 PM] [Camera FFmpeg] [Driveway] [9/9/2020, 12:33:26 PM] [Camera FFmpeg] [Driveway] [info] frame= 16 fps=0.0 q=-1.0 size= 1300kB time=00:00:00.54 bitrate=19723.7kbits/s speed=1.04x
[9/9/2020, 12:33:26 PM] [Camera FFmpeg] [Driveway] [info] frame= 29 fps= 28 q=-1.0 size= 2578kB time=00:00:01.07 bitrate=19739.6kbits/s speed=1.03x
[9/9/2020, 12:33:27 PM] [Camera FFmpeg] [Driveway] [info] frame= 41 fps= 27 q=-1.0 size= 2774kB time=00:00:01.54 bitrate=14755.2kbits/s speed=0.997x
[9/9/2020, 12:33:27 PM] [Camera FFmpeg] [Driveway] [info] frame= 52 fps= 25 q=-1.0 size= 3991kB time=00:00:01.97 bitrate=16597.4kbits/s speed=0.959x
[9/9/2020, 12:33:28 PM] [Camera FFmpeg] [Driveway] [info] frame= 67 fps= 26 q=-1.0 size= 4292kB time=00:00:02.57 bitrate=13681.4kbits/s speed=1.01x
[9/9/2020, 12:33:28 PM] [Camera FFmpeg] [Driveway] [info] frame= 80 fps= 26 q=-1.0 size= 5588kB time=00:00:03.10 bitrate=14766.5kbits/s speed= 1x
[9/9/2020, 12:33:29 PM] [Camera FFmpeg] [Driveway] [info] frame= 94 fps= 26 q=-1.0 size= 5859kB time=00:00:03.67 bitrate=13077.2kbits/s speed=1.01x
[9/9/2020, 12:33:30 PM] [Camera FFmpeg] [Driveway] [info] frame= 107 fps= 26 q=-1.0 size= 7142kB time=00:00:04.17 bitrate=14030.5kbits/s speed=0.999x
[9/9/2020, 12:33:30 PM] [Camera FFmpeg] [Driveway] [info] frame= 120 fps= 26 q=-1.0 size= 7411kB time=00:00:04.70 bitrate=12916.4kbits/s speed=1.01x
[9/9/2020, 12:33:31 PM] [Camera FFmpeg] [Driveway] [info] frame= 132 fps= 26 q=-1.0 size= 8678kB time=00:00:05.17 bitrate=13750.6kbits/s speed=0.999x
[9/9/2020, 12:33:31 PM] [Camera FFmpeg] [Driveway] [info] frame= 145 fps= 26 q=-1.0 size= 8938kB time=00:00:05.70 bitrate=12845.2kbits/s speed= 1x
[9/9/2020, 12:33:32 PM] [Camera FFmpeg] [Driveway] [info] frame= 159 fps= 26 q=-1.0 size= 10260kB time=00:00:06.26 bitrate=13425.8kbits/s speed=1.01x
[9/9/2020, 12:33:32 PM] [Camera FFmpeg] [Driveway] [info] frame= 171 fps= 25 q=-1.0 size= 10502kB time=00:00:06.73 bitrate=12783.4kbits/s speed= 1x
[9/9/2020, 12:33:33 PM] [Camera FFmpeg] [Driveway] [info] frame= 184 fps= 25 q=-1.0 size= 11776kB time=00:00:07.26 bitrate=13287.2kbits/s speed= 1x
[9/9/2020, 12:33:33 PM] [Camera FFmpeg] [Driveway] [info] frame= 197 fps= 25 q=-1.0 size= 12044kB time=00:00:07.76 bitrate=12714.1kbits/s speed= 1x
[9/9/2020, 12:33:34 PM] [Camera FFmpeg] [Driveway] [info] frame= 210 fps= 25 q=-1.0 size= 13323kB time=00:00:08.29 bitrate=13165.9kbits/s speed= 1x
[9/9/2020, 12:33:34 PM] [Camera FFmpeg] [Driveway] [info] frame= 223 fps= 25 q=-1.0 size= 13595kB time=00:00:08.79 bitrate=12669.9kbits/s speed= 1x
[9/9/2020, 12:33:35 PM] [Camera FFmpeg] [Driveway] [info] frame= 235 fps= 25 q=-1.0 size= 14857kB time=00:00:09.29 bitrate=13100.8kbits/s speed= 1x
[9/9/2020, 12:33:35 PM] [Camera FFmpeg] [Driveway Left Camera] Snapshot requested: 1280 x 720 [9/9/2020, 12:33:35 PM] [Camera FFmpeg] [Driveway Left Camera] Sending snapshot: 1280 x 720 [9/9/2020, 12:33:35 PM] [Camera FFmpeg] [Driveway Left Camera] Snapshot command: /usr/local/lib/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -rtsp_transport http -re -i rtsp://user:***@192...:554/cam/realmonitor?channel=1&subtype=0 -frames:v 1 -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -f image2 - [9/9/2020, 12:33:35 PM] [Camera FFmpeg] [Driveway] [info] frame= 249 fps= 25 q=-1.0 size= 15158kB time=00:00:09.86 bitrate=12593.4kbits/s speed= 1x
[9/9/2020, 12:33:36 PM] [Camera FFmpeg] [Driveway] [info] frame= 262 fps= 25 q=-1.0 size= 16443kB time=00:00:10.36 bitrate=13001.8kbits/s speed= 1x
[9/9/2020, 12:33:36 PM] [Camera FFmpeg] [Driveway] [info] frame= 274 fps= 25 q=-1.0 size= 16701kB time=00:00:10.86 bitrate=12597.9kbits/s speed= 1x
[9/9/2020, 12:33:36 PM] [Camera FFmpeg] [Driveway] Device appears to be inactive. Stopping stream. [9/9/2020, 12:33:36 PM] [Camera FFmpeg] [Driveway] Stopped video stream. [9/9/2020, 12:33:36 PM] [Camera FFmpeg] [Driveway] FFmpeg exited with code: null and signal: SIGKILL (Expected) [9/9/2020, 12:33:37 PM] [Camera FFmpeg] [Driveway] Snapshot requested: 1280 x 720

Wildcat1 avatar Sep 09 '20 18:09 Wildcat1

@Wildcat1 Are you running the betas on all those devices, or are some still on iOS 13?

I have an equal set of both so can simulate on either os version with the exception of the tvOS which I have 1 unit running tvOS 14. What is weird is on iOS 13 devices these streams won't start at all, just sit spinning so iOS14/tvOS14/iPadOS 14 is seemingly an improvement but still has the issues I mentioned.

Wildcat1 avatar Sep 09 '20 18:09 Wildcat1

Unfortunately, I don’t have any iOS 13 devices still around, but I have yet to be able to reproduce the issue with any of my cameras or iOS 14 beta devices. I do know of one thing that supposedly can lower the time to get video to display, I’ll see if I can get that implemented in the next few days. Was taking a bit of a break from coding in my free time, because between personal projects and my day job, I was getting darn close to burning out.

Failing after a successful stream is extremely odd failure condition. I’m not sure what could possibly causing that, especially given that I’m not seeing any obvious errors in your log.

Sunoo avatar Sep 09 '20 19:09 Sunoo

So maybe it is a iOS 14 issue? I am running iOS 14 too.

lishan89uc avatar Sep 09 '20 20:09 lishan89uc