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

August Doorbell Cam Pro Stopped Working after Homebridge Upgrade

Open yasserabdalla opened this issue 2 years ago • 18 comments

Hello, I used to have my Doorbell Cam Pro integrated with “Apple HomeKit” through “Homebridge” which runs on my Synology server, and using the script below, however, I noticed after upgrading to the recent Homebridge that it stopped working. Appreciate your advice if possible to make the required changes in my code?

The errors below happen every time I restart my Homebridge server on Synology and attempt to open the video window from within the Home application on my iphone.

Please see attached current code and error log from my Synology server.

Please see below a copy of my Homebridge code (Node.js Version v16.16.0) running on the Synology server:

{ "name": "Camera FFmpeg", "cameras": [ { "name": "DoorBellCam", "manufacturer": "August Home", "model": "Doorbell Cam Pro 2", "serialNumber": "D2GT7000LT", "firmwareRevision": "2.3", "unbridge": true, "videoConfig": { "source": "-i rtsp://[email protected]:[email protected]:554/live/stream", "stillImageSource": "-skip_frame nokey -i rtsp://[email protected]:[email protected]:554/live/stream", "vcodec": "libx264", "audio": true, "debug": true } } ], "platform": "Camera-ffmpeg" }

Synology Server error logs: [7/11/2022, 8:49:58 PM] DoorBellCam 2F5B is running on port 35080. [7/11/2022, 8:49:58 PM] Please add [DoorBellCam 2F5B] manually in Home app. Setup Code: 416-98-802 [7/11/2022, 8:49:58 PM] Homebridge v1.5.0 (HAP v0.10.2) (Homebridge) is running on port 51507. [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] Video stream requested: 1280 x 720, 30 fps, 299 kbps [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] Starting video stream: 1280 x 720, 30 fps, 299 kbps (AAC-eld) [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] Stream command: ffmpeg -i rtsp://[email protected]:[email protected]:554/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 30 -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 -b:v 299k -payload_type 99 -ssrc 53397 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params LUkgkK4pg8b1S8I28XWTNjjLiBGtPKWkrblY2KTC srtp://192.168.0.215:50203?rtcpport=50203&pkt_size=1316 -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 10147171 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params /79IeYvzUFjDW2vyErOsUdXDgaxq/8OiZqIiqoW3 srtp://192.168.0.215:55975?rtcpport=55975&pkt_size=188 -loglevel level+verbose -progress pipe:1 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] built with gcc 8.5.0 (GCC) [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libavutil 56. 22.100 / 56. 22.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libavcodec 58. 35.100 / 58. 35.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libavformat 58. 20.100 / 58. 20.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libavdevice 58. 5.100 / 58. 5.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libavfilter 7. 40.101 / 7. 40.101 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libswscale 5. 3.100 / 5. 3.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libswresample 3. 3.100 / 3. 3.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [info] libpostproc 55. 3.100 / 55. 3.100 [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [error] Unrecognized option 'srtp_out_suite'. [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] [fatal] Error splitting the argument list: Option not found [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error) [7/11/2022, 8:50:04 PM] [Camera FFmpeg] [DoorBellCam] Stopped video stream.

yasserabdalla avatar Jul 11 '22 12:07 yasserabdalla

Check here: https://sunoo.github.io/homebridge-camera-ffmpeg/configs/August-Doorbell-Cam-Pro.html

jlg89 avatar Jul 15 '22 12:07 jlg89

Appreciate it jlg89, I matched the provided config however, the error persists, pls see below a copy - thank you so much!

[7/15/2022, 1:29:50 PM] DoorBellCam 2F5B is running on port 34778. [7/15/2022, 1:29:50 PM] Please add [DoorBellCam 2F5B] manually in Home app. Setup Code: 416-98-802 [7/15/2022, 1:29:50 PM] Homebridge v1.5.0 (HAP v0.10.2) (Homebridge) is running on port 51507. [7/15/2022, 1:29:53 PM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot. [DoorBellCam 2F5B] Snapshot request handler provided empty image buffer! [7/15/2022, 1:30:01 PM] [Camera FFmpeg] [DoorBellCam] Starting video stream: 480 x 640, 10 fps, 299 kbps (AAC-eld) [7/15/2022, 1:30:01 PM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error) [7/15/2022, 1:30:01 PM] [Camera FFmpeg] [DoorBellCam] Stopped video stream.

yasserabdalla avatar Jul 15 '22 17:07 yasserabdalla

Hey , I just read this issue..

if your version is the same as mine, no doubt the issue comes from this line:

scale='min(1280,iw)':'min(720,ih)'

check #1326 and change the line 156

image

Maybe I can try to create a pull-request if this solves your issue too...

trigal avatar Jul 19 '22 18:07 trigal

Feel free to make a PR, I need to look into the changes you suggest though. It definitely worked before, so I wonder if a new release of FFmpeg tweaked the way it handles things slightly.

Sunoo avatar Jul 19 '22 18:07 Sunoo

Feel free to make a PR, I need to look into the changes you suggest though. It definitely worked before, so I wonder if a new release of FFmpeg tweaked the way it handles things slightly.

Hi Sunno, Augusto, and team,

Greatly , appreciate if you can open a new PR ... below is the latest troubleshooting I did as suggested by Augusto.

Yes, VLC can stream my August Camera clearly with video and sound, using either of the 2 user IDs "[email protected]" or "4169880226" however, I already changed the user ID to the latter one as suggested.

Also, I updated the file " streamingDelegate.js" as suggested, it ends with js in my case (not ts) :

resInfo.snapFilter = filters.join(','); if ((noneFilter < 0) && (resInfo.width > 0 || resInfo.height > 0)) { resInfo.resizeFilter = '"scale=' + (resInfo.width > 0 ? ''min(' + resInfo.width + ',iw)'' : 'iw') + ':' + (resInfo.height > 0 ? ''min(' + resInfo.height + ',ih)'' : 'ih') + ':force_original_aspect_ratio=decrease"'; filters.push(resInfo.resizeFilter); filters.push('scale=trunc(iw/2)*2:trunc(ih/2)*2');

Also, enabled the debugging, pls see below a copy with the following error:

[7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [error] Unrecognized option 'srtp_out_suite'. [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [fatal] Error splitting the argument list: Option not found [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error)"

Copy of the debug log below:

[7/19/2022, 7:08:50 PM] DoorBellCam 2F5B is running on port 38466. [7/19/2022, 7:08:50 PM] Please add [DoorBellCam 2F5B] manually in Home app. Setup Code: 416-98-802 [7/19/2022, 7:08:50 PM] Homebridge v1.5.0 (HAP v0.10.2) (Homebridge) is running on port 51507. [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] Video stream requested: 1280 x 720, 30 fps, 299 kbps [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] Starting video stream: 480 x 640, 10 fps, 299 kbps (AAC-eld) [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] Stream command: ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih)':force_original_aspect_ratio=decrease",scale=trunc(iw/2)*2:trunc(ih/2)*2 -b:v 299k -payload_type 99 -ssrc 6429728 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params XRo+4urGPFOvez9reUVqo+4cN4gWc4pGcLhbjrZt srtp://192.168.0.215:49957?rtcpport=49957&pkt_size=1316 -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 13360933 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params w+2dD4oCHR2Gz7zcPP3w4lHv5GLq3Yavw1lAk2as srtp://192.168.0.215:50061?rtcpport=50061&pkt_size=188 -loglevel level+verbose -progress pipe:1 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] built with gcc 8.5.0 (GCC) [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libavutil 56. 22.100 / 56. 22.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libavcodec 58. 35.100 / 58. 35.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libavformat 58. 20.100 / 58. 20.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libavdevice 58. 5.100 / 58. 5.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libavfilter 7. 40.101 / 7. 40.101 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libswscale 5. 3.100 / 5. 3.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libswresample 3. 3.100 / 3. 3.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [info] libpostproc 55. 3.100 / 55. 3.100 [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [error] Unrecognized option 'srtp_out_suite'. [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] [fatal] Error splitting the argument list: Option not found [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error) [7/19/2022, 7:08:53 PM] [Camera FFmpeg] [DoorBellCam] Stopped video stream.

Thank you so much.

yasserabdalla avatar Jul 21 '22 12:07 yasserabdalla

Feel free to make a PR, I need to look into the changes you suggest though. It definitely worked before, so I wonder if a new release of FFmpeg tweaked the way it handles things slightly.

Ok, I'll make a PR later today.

trigal avatar Jul 21 '22 12:07 trigal

@yasserabdalla great to see the debug process goes on :-)

now I see another issue, related with srtp_out_suite. It either seems that option is not valid or is a parameter passing error.

This the command homebridge-camera-ffmpeg is executing:

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih)':force_original_aspect_ratio=decrease",scale=trunc(iw/2)*2:trunc(ih/2)*2 -b:v 299k -payload_type 99 -ssrc 6429728 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params XRo+4urGPFOvez9reUVqo+4cN4gWc4pGcLhbjrZt srtp://192.168.0.215:49957?rtcpport=49957&pkt_size=1316 -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 13360933 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params w+2dD4oCHR2Gz7zcPP3w4lHv5GLq3Yavw1lAk2as srtp://192.168.0.215:50061?rtcpport=50061&pkt_size=188 -loglevel level+verbose -progress pipe:1

you should be able to open a terminal and write exactly this command. Did you try?

This is the ffmpeg manual https://ffmpeg.org/ffmpeg-protocols.html and the srtp_out_suite parameter accepts as inputs these values:

‘AES_CM_128_HMAC_SHA1_80’ ‘SRTP_AES128_CM_HMAC_SHA1_80’ ‘AES_CM_128_HMAC_SHA1_32’ ‘SRTP_AES128_CM_HMAC_SHA1_32’

try to execute the same command with the quotes, like -srtp_out_suite "AES_CM_128_HMAC_SHA1_80" or -srtp_out_suite 'AES_CM_128_HMAC_SHA1_80' and let's see if this is the issue here...

trigal avatar Jul 21 '22 12:07 trigal

Greatly appreciate it, Augusto,

The terminal returns the error below when I ran the command as is and when adding either of the quotes ' ' or " " - the error is: bash: syntax error near unexpected token `('

homebridge@AJRY:/volume1/homebridge $ -rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih)':force_original_aspect_ratio=decrease",scale=trunc(iw/2)*2:trunc(ih/2)*2 -b:v 299k -payload_type 99 -ssrc 6429728 -f rtp -srtp_out_suite 'AES_CM_128_HMAC_SHA1_80' -srtp_out_params XRo+4urGPFOvez9reUVqo+4cN4gWc4pGcLhbjrZt srtp://192.168.0.215:49957?rtcpport=49957&pkt_size=1316 -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 13360933 -f rtp -srtp_out_suite 'AES_CM_128_HMAC_SHA1_80' -srtp_out_params w+2dD4oCHR2Gz7zcPP3w4lHv5GLq3Yavw1lAk2as srtp://192.168.0.215:50061?rtcpport=50061&pkt_size=188 -loglevel level+verbose -progress pipe:1 bash: syntax error near unexpected token `('

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease",scale=trunc(iw/2)*2:trunc(ih/2)*2 -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1 bash: syntax error near unexpected token `('

yasserabdalla avatar Jul 21 '22 19:07 yasserabdalla

The only two '(' you have there are those related with the parameter scale, after the -filter:v

"scale='min(480,iw)':'min(640,ih)':force_original_aspect_ratio=decrease",scale=trunc(iw/2)*2:trunc(ih/2)*2

try this:

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1

and if it works, this one:

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1

or this one (without the trunc):

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1

trigal avatar Jul 21 '22 20:07 trigal

Appreciate it , Augusto .

All of them returned errors as below , the error is : Unrecognized option 'srtp_out_suite' Error splitting the argument list: Option not found

The First one:

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1[1] 17211 [2] 17212 bash: -vn: command not found bash: -loglevel: command not found [2]+ Exit 127 pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570 homebridge@AJRY:/volume1/homebridge $ ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Unrecognized option 'srtp_out_suite'. Error splitting the argument list: Option not found

The Second one:

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1 [2] 18457 [3] 18458 bash: -loglevel: command not found [1] Exit 1 ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833 homebridge@AJRY:/volume1/homebridge $ bash: -vn: command not found ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Unrecognized option 'srtp_out_suite'. Error splitting the argument list: Option not found

The Third one:

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1 [4] 19078 [5] 19079 bash: -vn: command not found bash: -loglevel: command not found [2] Exit 1 ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833 [3] Exit 127 pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570 [5]+ Exit 127 pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570 homebridge@AJRY:/volume1/homebridge $ ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Unrecognized option 'srtp_out_suite'. Error splitting the argument list: Option not found

yasserabdalla avatar Jul 21 '22 21:07 yasserabdalla

So, from your answer, I see more problems.

  1. for one reason, the plugin is using two "scale" parameters. I don't know why that second trunc is set, but I think there's an issue there with the current version of ffmpeg .. these are the lines I have in my configuration, are yours the same? image image

moreover, make sure you don't have any other configuration parameter set in the advanced tab: image

  1. bash: -loglevel: command not found and bash: -vn: command not found .. bash?! I I'm not sure what's going on. bash is the command line interpreter and you just executed "ffmpeg", not loglevel or vn commands. Can't really understand what's happening here, maybe you should try to each ffmpeg parameter step by step to catch what triggers the error instead of putting the whole line.
  2. regarding the loglevel, the command is wrong. -loglevel level+verbose is not a valid ffmpeg parameter, should be -loglevel verbose , see #1325
  3. Unrecognized option 'srtp_out_suite'. The current version of ffmpeg should support this. See https://ffmpeg.org/ffmpeg-protocols.html . What version of ffmpeg are you using? ffmpeg -version

trigal avatar Jul 21 '22 23:07 trigal

Hi Augusto,

Image settings updated

I updated all the config to zeros to match yours as per the attached screen captures Picture1

I used to have no advanced settings as below:

Picture2

Please note , I can't change the values of CODEC and packet size to zero, it seems there are default values.

Versions

Homebridge is V1.5

ffmpeg Version as per the Homebridge plugins interface is V3.1.4 as per the screen capture below.

Picture3

fame -version returns V4.1.8 as per below:

ffmpeg -version ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100

Log command corrected

Corrected -loglevel level+verbose with -loglevel verbose as per the provided link.

Below is sample when re-run the total command again , I agree that sounds an issue with inconsistent versions as 'srtp_out_suite' seems a feature of v3.37 only as per the link your provided (to the best of my understanding)

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1 [1] 20292 [2] 20293 bash: -vn: command not found bash: -loglevel: command not found [2]+ Exit 127 pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570

yasserabdalla avatar Jul 22 '22 00:07 yasserabdalla

First, this is my configuration setup

Homebridge v1.5 Homebridge-camera-ffmpeg v3.1.4

My ffmpeg version are a little older than yours, as I had to install everything inside an old 32bit machine .. please don't ask... :-)

homebridge@homebridge:~$ ffmpeg -version ffmpeg version 3.2.18-0+deb9u1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516 configuration: --prefix=/usr --extra-version=0+deb9u1 --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 34.101 / 55. 34.101 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.101 / 57. 56.101 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libavresample 3. 1. 0 / 3. 1. 0 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100

Second, bash: -vn: command not found and bash: -loglevel: command not found are very strange. You wrote 1 command (ffmpeg + options) and bash should (must?) read only one. I suspect there's a problem with your command string, maybe it includes a return, a space, or something that is not parsed correctly by the command line interpreter (bash) and therefore more than one command is executed.

I see that you fixed the code with #1325 but you still have that part! See at the end of your string:

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1

you have:

-loglevel level+verbose -progress pipe:1ogress pipe:1

so there's still something wrong. I believe that this is related to the & before pkt_size=88. To test this, please after the whole command write

echo $pkt_size

if the terminal gives you 88 as result, bingo... the issue here is because & in bash means to execute whatever on the left side to run in background, so basically you're executing 2 (actually, 3) commands with the same line.

this should fix the problem, try it out. please note that I also changed the -loglevel problem here.

ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z "srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316" -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm "srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88" -loglevel verbose -progress pipe:1ogress pipe:1

if yes, we should modify the code to add the quote marks also here...

trigal avatar Jul 22 '22 08:07 trigal

Appreciate it Augusto, I started over from the original file "streamingDelegate.js" and redone the earlier edits very carefully to make sure there is no overseen spaces/enters that may impact the parsing of the file.

Debug Log

As a result of this , I can see the debug log on the Status screen as below:

[7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Stream command: ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -f rawvideo -preset ultrafast -tune zerolatency -payload_type 99 -ssrc 5264549 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params tZpUwEZQmxxRXX2PqrZc+G9AoiDayPrs9aTOlvNN srtp://192.168.0.215:52267?rtcpport=52267&pkt_size=1316 -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 6360706 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params fX4LBrJV9RPht0ZWoqWx43bfCKnwdrzqJ8P7aORj srtp://192.168.0.215:52096?rtcpport=52096&pkt_size=188 -loglevel verbose -progress pipe:1 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] built with gcc 8.5.0 (GCC) [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libavutil 56. 22.100 / 56. 22.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libavcodec 58. 35.100 / 58. 35.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libavformat 58. 20.100 / 58. 20.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libavdevice 58. 5.100 / 58. 5.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libavfilter 7. 40.101 / 7. 40.101 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libswscale 5. 3.100 / 5. 3.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libswresample 3. 3.100 / 3. 3.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] libpostproc 55. 3.100 / 55. 3.100 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Unrecognized option 'srtp_out_suite'. [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Error splitting the argument list: Option not found [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error) [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Stopped video stream. [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Snapshot requested: 1280 x 720 [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Snapshot command: ffmpeg -i rtsp://4169880226:[email protected]/live/stream -vframes 1 -r 1 -frames:v 1 -f image2 - -hide_banner -loglevel error [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] [Snapshot] rtsp://4169880226:[email protected]/live/stream: Protocol not found [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] [Snapshot] Did you mean file:rtsp://4169880226:[email protected]/live/stream? [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Fetching snapshot took 0.02 seconds. [7/22/2022, 12:03:42 PM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot.

When I ran the 2 sets of commands you recommended in the last note with the following results, I couldn't get the packet size in either case!

The First Set of Commands

homebridge@AJRY:/volume1/homebridge $ homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88 -loglevel level+verbose -progress pipe:1ogress pipe:1 [1] 23350 [2] 23351 bash: homebridge@AJRY:/volume1/homebridge: No such file or directory bash: -vn: command not found bash: -loglevel: command not found [1]- Exit 127 homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z srtp://192.168.0.215:53833?rtcpport=53833 [2]+ Exit 127 pkt_size=1316 -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm srtp://192.168.0.215:64570?rtcpport=64570 homebridge@AJRY:/volume1/homebridge $ echo $pkt_size

Note: no packet size is returned whatsoever !

The Second Set of Commands

homebridge@AJRY:/volume1/homebridge $ ffmpeg -i rtsp://4169880226:[email protected]/live/stream -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 10 -f rawvideo -preset ultrafast -tune zerolatency -filter:v "scale='min(480,iw)':'min(640,ih):force_original_aspect_ratio=decrease, scale=trunc(iw/2)*2:trunc(ih/2)*2" -b:v 299k -payload_type 99 -ssrc 13698865 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params p72BVZpSHSWQYESweG/lElI9IldFthVxuAeDE05Z "srtp://192.168.0.215:53833?rtcpport=53833&pkt_size=1316" -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 1078735 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l1zesYmSlxbTR6RIhrHSE+JIRMvl8bsrBMGeJCOm "srtp://192.168.0.215:64570?rtcpport=64570&pkt_size=88" -loglevel verbose -progress pipe:1ogress pipe:1 ffmpeg version 4.1.8 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 8.5.0 (GCC) configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --disable-stripping --enable-version3 --enable-encoders --enable-pthreads --disable-protocols --disable-protocol=rtp --enable-protocol=file --enable-protocol=pipe --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffprobe --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-cuvid --disable-nvenc --disable-decoder=aac --disable-decoder=aac_fixed --disable-encoder=aac --disable-decoder=amrnb --disable-decoder=ac3 --disable-decoder=ac3_fixed --disable-encoder=zmbv --disable-encoder=dca --disable-decoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --disable-encoder=hevc_vaapi --disable-decoder=hevc --disable-muxer=hevc --disable-demuxer=hevc --disable-parser=hevc --disable-bsf=hevc_mp4toannexb --x86asmexe=yasm --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-wrap-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Unrecognized option 'srtp_out_suite'. Error splitting the argument list: Option not found

Note: no packet size is returned whatsoever !

yasserabdalla avatar Jul 22 '22 16:07 yasserabdalla

In the first set of commands, you still have the error on both -vn and -loglevel parameters, so the important set here is the 2nd set. You correctly changed the loglevel part (in fact, you can see “-loglevel verbose” instead of “-loglevel level+verbose”) and also, and more important, ffmpeg parsed ALL the string without any subcommand executed from bash. This is because you correctly put the quotes around srtp and now -vn is recognized as parameter of ffmpeg.

Regarding ‘srtp_out_suite’ … i don’t know, but I’ll investigate a little and write here in the next days. I think we’re pretty close to solve this issue! :-) at least, now is a problem with ffmpeg and not with bash anymore!

trigal avatar Jul 24 '22 10:07 trigal

https://github.com/Sunoo/homebridge-camera-ffmpeg/issues/1238

It seems related with the version of ffmpeg.. I don’t know exactly what’s happening here because I’m using an older release than yours, but it seems that this is the answer.

trigal avatar Jul 24 '22 17:07 trigal

Much appreciated, Augusto.

Look forward to a fix/new version update for the ffmpeg otherwise, I'll see if I can downgrade my current version to 3.1.4 like yours.

Thank you so much :)

yasserabdalla avatar Jul 25 '22 13:07 yasserabdalla

just to know... do you have libsrt in your system? I see from https://ffmpeg.org/ffmpeg-protocols.html#srt the srtp depends on that library.. maybe this is the problem, not ffmpeg by itself

i search with apt cache all the matching libraries in ubuntu and these are the results:

[sudo] password for johnny5:  
libsrt-dev - Secure Reliable Transport UDP streaming library  
libsrt-doc - Secure Reliable Transport UDP streaming library  
libsrt1 - Secure Reliable Transport UDP streaming library  
libsrtp2-1 - Secure RTP (SRTP) and UST Reference Implementations - shared library  
libsrtp2-1-dbg - Secure RTP (SRTP) and UST Reference Implementations - debugging symbols  
libsrtp2-dev - Secure RTP (SRTP) and UST Reference Implementations - development files  
libsrtp2-docs - Secure RTP (SRTP) and UST Reference Implementations - documentation  
python-pylibsrtp-doc - Python wrapper around libsrtp (documentation)  
python3-pylibsrtp - Python wrapper around libsrtp

Try to do the same, i would try to install libsrt1 and libsrtp2-1.. not exact science, but .. :-)

trigal avatar Jul 26 '22 08:07 trigal

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 23 '22 09:08 github-actions[bot]