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

FFmpeg exited with code: 1 and signal: null (Error)

Open trigal opened this issue 2 years ago • 3 comments

  • plugin v3.1.4
  • 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
  • Homebridge v1.5.0 (HAP v0.10.2)

https://github.com/Sunoo/homebridge-camera-ffmpeg/blob/dfbf2cb10e772ed815aaf0843850b841bf1ded2a/src/streamingDelegate.ts#L156

The line above is generating an error with the loglevel, enabling debug in homebridge i saw this :

ffmpeg -i rtsp://xxx.xxx.xxx.xxx:554/onvif1 -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 15 -f rawvideo -preset ultrafast -tune zerolatency -filter:v scale='min(1920,iw)':'min(1080,ih)':force_original_aspect_ratio=decrease,

and changing character by character I discovered the issues comes from the scale parameter. I changed

I changed: resInfo.resizeFilter = 'scale=' + (resInfo.width > 0 ? '\'min(' + resInfo.width + ',iw)\'' : 'iw') + ':' + (resInfo.height > 0 ? '\'min(' + resInfo.height + ',ih)\'' : 'ih') + ':force_original_aspect_ratio=decrease'; to (I put the double quote marks): resInfo.resizeFilter = '"scale=' + (resInfo.width > 0 ? '\'min(' + resInfo.width + ',iw)\'' : 'iw') + ':' + (resInfo.height > 0 ? '\'min(' + resInfo.height + ',ih)\'' : 'ih') + ':force_original_aspect_ratio=decrease"';

and now works like a charm.

trigal avatar Jul 18 '22 14:07 trigal

Hi Trigal,

It seems I have a similar issue with my August Doorbell Cam Pro 2: I'm getting a similar error message " FFmpeg exited with code: 1 and signal: null (Error)".

Appreciate it if you pls check the details below as per case #1324 and recommend any changes in my code below.

P.S. I'm not a basic user and trying to learn some coding skills, much appreciated :)

=================================================== Upgraded to the latest Homebridge UI - homebridge-config-ui-x v4.50.0 but the issue persists!

My current configuration is as below as per the recommended standard config on this site:

{ "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]/live/stream", "stillImageSource": "-i rtsp://[email protected]:[email protected]/live/stream -vframes 1 -r 1", "maxStreams": 2, "maxWidth": 480, "maxHeight": 640, "maxFPS": 10, "audio": true, "debug": false } } ], "platform": "Camera-ffmpeg"

Current errors on the log as below:

[7/18/2022, 7:58:11 AM] DoorBellCam 2F5B is running on port 41156. [7/18/2022, 7:58:11 AM] Please add [DoorBellCam 2F5B] manually in Home app. Setup Code: 416-98-802 [7/18/2022, 7:58:11 AM] Homebridge v1.5.0 (HAP v0.10.2) (Homebridge) is running on port 51507. [7/18/2022, 7:59:21 AM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot. [DoorBellCam 2F5B] Snapshot request handler provided empty image buffer! [7/18/2022, 7:59:24 AM] [Camera FFmpeg] [DoorBellCam] Starting video stream: 480 x 640, 10 fps, 299 kbps (AAC-eld) [7/18/2022, 7:59:25 AM] [Camera FFmpeg] [DoorBellCam] FFmpeg exited with code: 1 and signal: null (Error) [7/18/2022, 7:59:25 AM] [Camera FFmpeg] [DoorBellCam] Stopped video stream. [7/18/2022, 7:59:34 AM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot. [DoorBellCam 2F5B] Snapshot request handler provided empty image buffer! [7/18/2022, 7:59:44 AM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot. [DoorBellCam 2F5B] Snapshot request handler provided empty image buffer! [7/18/2022, 8:00:29 AM] [Camera FFmpeg] [DoorBellCam] Failed to fetch snapshot. [DoorBellCam 2F5B] Snapshot request handler provided empty image buffer!

yasserabdalla avatar Jul 18 '22 17:07 yasserabdalla

Hi @yasserabdalla ,

from your log it seems exactly the same issue I had with my system, it was not that doorbell but we are both trying to create a homekit camera with this platform.

This is my config:

{ "name": "Camera FFmpeg", "usermqtt": "xxxxx", "passmqtt": "xxxxx", "cameras": [ { "name": "XXXXXXX", "unbridge": true, "videoConfig": { "source": "-i rtsp://xxx.xxx.xxx.xxx:554/onvif2", "maxWidth": 0, "maxHeight": 0, "maxFPS": 15, "vcodec": "libx264", "audio": false, "debug": false } } ], "_bridge": { "username": "xx:xx:xx:xx:xx:xx", "port": 33337 }, "platform": "Camera-ffmpeg" }

but if the case is the same as mine, there's nothing wrong with the configuration, but with the software itself, you should change streamingDelegate.ts , editing the line I wrote in my previous post. If you want to debug as I did, try changing the value of "debug": false to "debug": true and look at the logs in homebridge, click on the square wave button, you'll see the line that is causing that error. Then you can open a terminal and paste the exact line to see if the same error occurs and try to identify what's wrong. Feel free to copy-paste here the text, I'll try to help you.

But ... first: can you see the image using VLC and opening the rtsp://[email protected]:[email protected]/live/stream stream?

image

I'm writing this because I read your username and it contains a @ character .. and I really thing this can create troubles, maybe you should escape that symbol .. who knows :-) check it out!

Bests, Augusto

trigal avatar Jul 19 '22 18:07 trigal

Much appreciated, 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 19 '22 23:07 yasserabdalla

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 17 '22 01:08 github-actions[bot]