Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg killed with signal ILL #679

Closed
DarthJonathan opened this issue Jul 21, 2020 · 17 comments
Closed

ffmpeg killed with signal ILL #679

DarthJonathan opened this issue Jul 21, 2020 · 17 comments
Labels

Comments

@DarthJonathan
Copy link

Describe The Bug:

Cannot start stream on home app, snapshot are available, ffmpeg output to .mp4 in raspberry works but when streaming got error in ffmpeg.

To Reproduce:

  • Open Home APP
  • Open Camera Tile
  • Keeps on loading, and in home bridge logs, shows SIGILL

Expected behavior:

Supposed to stream to ios device

Logs:

[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Starting Front Porch video stream (1280x720, 10 fps, 299 kbps, 1316 mtu)... debug enabled
[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Front Porch command: ffmpeg -rtsp_transport udp -v verbose -i rtsp://user:pass@192.168.1.x:554/onvif2 -map 0:0 -vcodec h264 -pix_fmt yuv420p -r 10 -f rawvideo -preset ultrafast -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 598k -maxrate 299k -payload_type 99 -ssrc 15290808 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params uuid srtp://192.168.1.x:60881?rtcpport=60881&localrtcpport=60881&pkt_size=1316 -map 0:0 -acodec libfdk_aac -profile:a aac_eld -flags +global_header -f null -ar 16k -b:a 24k -bufsize 24k -ac 1 -payload_type 110 -ssrc 5874408 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params uuid srtp://192.168.1.x:58366?rtcpport=58366&localrtcpport=58366&pkt_size=188 -loglevel level+verbose
[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Front Porch: [info] 
[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Front Porch: ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
[info]   built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
[info]   configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/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 --enable-omx-rpi --enable-mmal --enable-indev=alsa --enable-outdev=alsa
[info]   libavutil      56. 31.100 / 56. 31.100
[info]   libavcodec     58. 54.100 / 58. 54.100
[info]   libavformat    58. 29.100 / 58. 29.100
[info]   libavdevice    58.  8.100 / 58.  8.100
[info]   libavfilter     7. 57.100 /  7. 57.100
[info]   libswscale      5.  5.100 /  5.  5.100
[info]   libswresample   3.  5.100 /  3.  5.100
[info]   libpostproc    55.  5.100 / 55.  5.100

[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Front Porch: [tcp @ 0x2bf1310] 
[7/22/2020, 12:28:10 AM] [Camera-ffmpeg] Front Porch: [verbose] Starting connection attempt to 192.168.1.201 port 554

[7/22/2020, 12:28:11 AM] [Camera-ffmpeg] Front Porch: [tcp @ 0x2bf1310] [verbose] Successfully connected to 192.168.1.201 port 554

[7/22/2020, 12:28:13 AM] [Camera-ffmpeg] Front Porch: [rtsp @ 0x2bef2f0] 
[7/22/2020, 12:28:13 AM] [Camera-ffmpeg] Front Porch: [verbose] SDP:
v=0
o=- 1421069297525233 1 IN IP4 192.168.1.201
s=H.264 Video, RtspServer_0.0.0.2
t=0 0
a=tool:RtspServer_0.0.0.2
a=type:broadcast
a=control:*
a=range:npt=0-
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42001F;sprop-parameter-sets=Z0IAH5WoFAFuQA==,aM48gA==
a=control:track1


[7/22/2020, 12:28:13 AM] [Camera-ffmpeg] Front Porch: [rtsp @ 0x2bef2f0] 
[7/22/2020, 12:28:13 AM] [Camera-ffmpeg] Front Porch: [verbose] setting jitter buffer size to 500

[7/22/2020, 12:28:15 AM] [Camera-ffmpeg] Front Porch: [h264 @ 0x2bf26e0] 
[7/22/2020, 12:28:15 AM] [Camera-ffmpeg] Front Porch: [verbose] Reinit context to 320x192, pix_fmt: yuv420p

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [info] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: Input #0, rtsp, from 'rtsp://admin:Joseph0510@192.168.1.201:554/onvif2':
[info]   Metadata:
[info]     title           : H.264 Video, RtspServer_0.0.0.2
[info]   Duration: N/A, start: 0.067000, bitrate: N/A
[info]     Stream #0:0: Video: h264 (Baseline), 1 reference frame, yuv420p(progressive, left), 320x192, 15 tbr, 90k tbn, 180k tbc
[verbose] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: Matched encoder 'libx264' for codec 'h264'.

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [warning] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: Codec AVOption b (set bitrate (in bits/s)) specified for output file #1 (srtp://192.168.1.106:58366?rtcpport=58366&localrtcpport=58366&pkt_size=188) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [warning] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: Codec AVOption profile () specified for output file #1 (srtp://192.168.1.106:58366?rtcpport=58366&localrtcpport=58366&pkt_size=188) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [info] Stream mapping:
[info]   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
[info]   Stream #0:0 -> #1:0 (h264 (native) -> mpeg4 (native))
[info] Press [q] to stop, [?] for help

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [h264 @ 0x2cc9320] [verbose] Reinit context to 320x192, pix_fmt: yuv420p

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [Parsed_scale_0 @ 0x2c298a0] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [verbose] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: w:1280 h:720 flags:'bicubic' interl:0
[graph 0 input from stream 0:0 @ 0x2c9be50] [verbose] w:320 h:192 pixfmt:yuv420p tb:1/90000 fr:15/1 sar:0/1 sws_param:flags=2

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [Parsed_scale_0 @ 0x2c298a0] 
[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] Front Porch: [verbose] w:320 h:192 fmt:yuv420p sar:0/1 -> w:1280 h:720 fmt:yuv420p sar:0/1 flags:0x4

[7/22/2020, 12:28:17 AM] [Camera-ffmpeg] [Front Porch] ffmpeg exited with code: null and signal: SIGILL (Unexpected)

Homebridge Config:

"cameras": [
                {
                    "name": "Front Porch",
                    "videoConfig": {
                        "source": "-re -rtsp_transport udp -v verbose -i rtsp://user:pass@192.168.1.x:554/onvif2",
                        "maxStreams": 2,
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 10,
                        "maxBitrate": 300,
                        "vcodec": "h264",
                        "mapaudio": "0:0",
                        "audio": true,
                        "debug": true
                    }
                }
            ],
            "platform": "Camera-ffmpeg"

Screenshots:

Environment:

  • Node.js Version: 11.15.0
  • NPM Version: 6.14.6
  • Homebridge Version: homebridge
  • Homebridge Camera FFmpeg Version: 2.3.2
  • Homebridge Config UI X Plugin Version: 4.23.2
  • Operating System: Raspbian
@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

That’s odd... “SIGILL” means an illegal instruction was encountered. Which would be an issue with the included version of FFmpeg (the ffmpeg-for-homebridge package). I’d recommend opening an issue over there, since they’d likely be best equipped to help.

In the meantime, what version of Raspberry Pi are you running on? What version of Raspbian are you on? Perhaps there is some incompatibility between that package and one of those?

@DarthJonathan
Copy link
Author

I know, I'm running raspberry pi 1B+ (armv6)

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

might be something wrong with ffmpeg for homebridge

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Yea, I’d open an issue with them, it’s possible they haven’t tested it on a Pi that old.

@DarthJonathan
Copy link
Author

Hmm, will do then, should be the same as pi zero w shouldn't it?

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

I’m not super up on the CPUs used in all their models, but I believe you are correct there.

@DarthJonathan
Copy link
Author

I'll close this one since it's a problem with ffmpeg not the plugin, thanks sunoo!

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Sure thing, if for some reason they think it might be something to do with this plugin, I’ll be happy to step in again and try to help.

@DarthJonathan
Copy link
Author

Although I saw the ffmpeg used by the plugin and the one installed on cli are different

ffmpeg cli : ffmpeg version 4.1.6-1~deb10u1+rpt1 Copyright (c) 2000-2020 the FFmpeg developers
ffmpeg homebridge : ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers

Can I choose which one used by the plugin for the sake of trying? thanks

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Yes, set the videoProcessor config option to ‘ffmpeg’, you’ll need to set audio to false though, as most versions do not support the proper codecs for that.

@DarthJonathan
Copy link
Author

seems to be working, got further I guess

Error initializing output stream 1:0 -- Error while opening encoder for output stream #1:0 - maybe incorrect parameters such as bit_rate, rate, width or height

latest error, from ffmpeg though

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

If I remember correctly, stream 1:0 is the audio stream. The audio encoder is not compiled into most versions of ffmpeg, that’s why there is a project to supply a specific version for Homebridge.

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Also, just noticed a potential issue with the config you posted earlier. You are defining mapaudio as 0:0, but not defining mapvideo so that is at its default value of 0:0. It shouldn’t be possible to have both of those on the same stream.

@DarthJonathan
Copy link
Author

Interesting, because the stream does have audio, might be on 1:0 then? let me retry

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Typically a stream from a camera would have video on 0:0 and audio on 0:1, but that can change.

@DarthJonathan
Copy link
Author

Yup removing the audio stream and using the ffmpeg cli works, might need to raise the SIGILL issue to homebridge ffmpeg then, Thanks a lot !

@Sunoo
Copy link
Owner

Sunoo commented Jul 21, 2020

Sure thing, hope they can figure that bit out.

@DarthJonathan
Copy link
Author

FYI, for all people reading this, if your camera already streams h264, just use codec "copy", should forward your stream without encoding it (no strain from CPU).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants