Live image fails to load FFmpeg exited with code 1
**Describe Your Problem:**
Live image feed won't load in Apple Home (iOS 13.5) (HomeKit) served by Homebridge/HOOBS.

homebridge-camera-ffmpeg final error:
ERROR: FFmpeg exited with code 1

Have tried many configurations without success including multiple video codec options.
Loads fine with no problems in VLC using rtsp (H.264 video AAC audio).
Using old iZon View IP camera with HOOBS/homebridge.
Static image loads without problem.

**Logs:**

```
[Homebridge] ffmpeg -i http://admin:anotherpassword@192.168.1.14/cgi-bin/img-d1.cgi -t 1 -vf hflip,vflip,scale=480:270 -f image2 -
[Homebridge] [5/29/2020, 3:10:29 PM] [Camera-ffmpeg] Start streaming video from GarageCam with 640:360@29fps (132kBit)
[Homebridge] /home/hoobs/.hoobs/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -re -i rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA -map 1 -vcodec libx264 -pix_fmt yuv420p -r 29 -f rawvideo -x264-params "intra-refresh=1:bframes=0" -vf scale=640:360,hflip,vflip -b:v 132k -bufsize 132k -maxrate 132k -payload_type 99 -ssrc 11719052 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params WLdketZvJSvRA/E7oxLzIlgBWWGuju4hQdyYY1la srtp://192.168.1.20:55084?rtcpport=55084&localrtcpport=55084&pkt_size=1316 -map 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 280896 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params TUZV2J13hpKag6Pdaq2T+4p3DqE7zaZ6iWfQR6jb srtp://192.168.1.20:54252?rtcpport=54252&localrtcpport=54252&pkt_size=1316 -loglevel debug
[Homebridge] ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
[Homebridge] built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
[Homebridge] 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
[Homebridge] libavutil      56. 31.100 / 56. 31.100
[Homebridge] libavcodec     58. 54.100 / 58. 54.100
[Homebridge] libavformat    58. 29.100 / 58. 29.100
[Homebridge] libavdevice    58.  8.100 / 58.  8.100
[Homebridge] libavfilter     7. 57.100 /  7. 57.100
[Homebridge] libswscale      5.  5.100 /  5.  5.100
[Homebridge] libswresample   3.  5.100 /  3.  5.100
[Homebridge] libpostproc    55.  5.100 / 55.  5.100
[Homebridge] Splitting the commandline.
[Homebridge] Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
[Homebridge] Reading option '-i' ... matched as input url with argument 'rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA'.
[Homebridge] Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1'.
[Homebridge] Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
[Homebridge] Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
[Homebridge] Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '29'.
[Homebridge] Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
[Homebridge] Reading option '-x264-params' ...
[Homebridge] matched as AVOption 'x264-params' with argument '"intra-refresh=1:bframes=0"'.
[Homebridge] Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=640:360,hflip,vflip'.
[Homebridge] Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '132k'.
[Homebridge] Reading option '-bufsize' ... matched as AVOption 'bufsize' with argument '132k'.
[Homebridge] Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '132k'.
[Homebridge] Reading option '-payload_type' ... matched as AVOption 'payload_type' with argument '99'.
[Homebridge] Reading option '-ssrc' ... matched as AVOption 'ssrc' with argument '11719052'.
[Homebridge] Reading option '-f' ... matched as option 'f' (force format) with argument 'rtp'.
[Homebridge] Reading option '-srtp_out_suite' ... matched as AVOption 'srtp_out_suite' with argument 'AES_CM_128_HMAC_SHA1_80'.
[Homebridge] Reading option '-srtp_out_params' ... matched as AVOption 'srtp_out_params' with argument 'WLdketZvJSvRA/E7oxLzIlgBWWGuju4hQdyYY1la'.
[Homebridge] Reading option 'srtp://192.168.1.20:55084?rtcpport=55084&localrtcpport=55084&pkt_size=1316' ... matched as output url.
[Homebridge] Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
[Homebridge] Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'.
[Homebridge] Reading option '-profile:a' ... matched as option 'profile' (set profile) with argument 'aac_eld'.
[Homebridge] Reading option '-flags' ... matched as AVOption 'flags' with argument '+global_header'.
[Homebridge] Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
[Homebridge] Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '16k'.
[Homebridge] Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '24k'.
[Homebridge] Reading option '-bufsize' ... matched as AVOption 'bufsize' with argument '24k'.
[Homebridge] Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '1'.
[Homebridge] Reading option '-payload_type' ... matched as AVOption 'payload_type' with argument '110'.
[Homebridge] Reading option '-ssrc' ... matched as AVOption 'ssrc' with argument '280896'.
[Homebridge] Reading option '-f' ... matched as option 'f' (force format) with argument 'rtp'.
[Homebridge] Reading option '-srtp_out_suite' ...
[Homebridge] matched as AVOption 'srtp_out_suite' with argument 'AES_CM_128_HMAC_SHA1_80'.
[Homebridge] Reading option '-srtp_out_params' ...
[Homebridge] matched as AVOption 'srtp_out_params' with argument 'TUZV2J13hpKag6Pdaq2T+4p3DqE7zaZ6iWfQR6jb'.
[Homebridge] Reading option 'srtp://192.168.1.20:54252?rtcpport=54252&localrtcpport=54252&pkt_size=1316' ... matched as output url.
[Homebridge] Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
[Homebridge] Finished splitting the commandline.
[Homebridge] Parsing a group of options: global .
[Homebridge] Applying option loglevel (set logging level) with argument debug.
[Homebridge] Successfully parsed a group of options.
[Homebridge] Parsing a group of options: input url rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA.
[Homebridge] Applying option re (read input at native frame rate) with argument 1.
[Homebridge] Successfully parsed a group of options.
[Homebridge] Opening an input file: rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA.
[Homebridge] [tcp @ 0x2d422a0] No default whitelist set
[Homebridge] [tcp @ 0x2d422a0] Original list of addresses:
[Homebridge] [tcp @ 0x2d422a0] Address 192.168.1.14 port 554
[Homebridge] [tcp @ 0x2d422a0] Interleaved list of addresses:
[Homebridge] [tcp @ 0x2d422a0] Address 192.168.1.14 port 554
[Homebridge] [tcp @ 0x2d422a0] Starting connection attempt to 192.168.1.14 port 554
[Homebridge] [tcp @ 0x2d422a0] Successfully connected to 192.168.1.14 port 554
[Homebridge] [rtsp @ 0x2d40270] SDP:
[Homebridge] v=0
[Homebridge] o=- -2126832873411811084 -2126832873410720162 IN IP4 0.0.0.0
[Homebridge] c=IN IP4 0.0.0.0
[Homebridge] a=tool: RtpRtspServer
[Homebridge] a=range:npt=0-
[Homebridge] m=audio 0 RTP/AVP 98
[Homebridge] a=rtpmap:98 mpeg4-generic/16000/1
[Homebridge] a=fmtp:98 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1408; SizeLength=13;IndexLength=3; IndexDeltaLength=3; Profile=1;
[Homebridge] a=control:rtsp://192.168.1.14:554/test_VGA/trackID=0
[Homebridge] m=video 0 RTP/AVP 96
[Homebridge] a=rtpmap:96 H264/90000
[Homebridge] a=fmtp:96 packetization-mode=1;profile-level-id=42001e;sprop-parameter-sets=Z0KgHucoFAe2AoEAAAu7AAK/IOAAAAmJaAAATEtD//4wAAAExLQAACYlof//Ag==,aN48gA==;
[Homebridge] a=control:rtsp://192.168.1.14:554/test_VGA/trackID=1
[Homebridge] Failed to parse interval end specification ''
[Homebridge] [rtsp @ 0x2d40270] audio codec set to: aac
[Homebridge] [rtsp @ 0x2d40270] audio samplerate set to: 16000
[Homebridge] [rtsp @ 0x2d40270] audio channels set to: 1
[Homebridge] [rtsp @ 0x2d40270] video codec set to: h264
[Homebridge] [rtsp @ 0x2d40270] RTP Packetization Mode: 1
[Homebridge] [rtsp @ 0x2d40270] RTP Profile IDC: 42 Profile IOP: 0 Level: 1e
[Homebridge] [rtsp @ 0x2d40270] Extradata set to 0x2d46e38 (size: 58)
[Homebridge] [rtp @ 0x2d42790] No default whitelist set
[Homebridge] [udp @ 0x2d47280] No default whitelist set
[Homebridge] [udp @ 0x2d47280] end receive buffer size reported is 131072
[Homebridge] [udp @ 0x2d57600] No default whitelist set
[Homebridge] [udp @ 0x2d57600] end receive buffer size reported is 131072
[Homebridge] [rtsp @ 0x2d40270] setting jitter buffer size to 500
[Homebridge] [rtp @ 0x2d67970] No default whitelist set
[Homebridge] [udp @ 0x2d68380] No default whitelist set
[Homebridge] [udp @ 0x2d68380] end receive buffer size reported is 131072
[Homebridge] [udp @ 0x2d786e0] No default whitelist set
[Homebridge] [udp @ 0x2d786e0] end receive buffer size reported is 131072
[Homebridge] [rtsp @ 0x2d40270] setting jitter buffer size to 500
[Homebridge] [rtsp @ 0x2d40270] hello state=0
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[Homebridge] [h264 @ 0x2d469c0] Format yuv420p chosen by get_format().
[Homebridge] [h264 @ 0x2d469c0] Reinit context to 640x480, pix_fmt: yuv420p
[Homebridge] [h264 @ 0x2d469c0] Frame num gap 11 6
[Homebridge] [h264 @ 0x2d469c0] Frame num gap 11 7
[Homebridge] [h264 @ 0x2d469c0] Frame num gap 11 8
[Homebridge] [h264 @ 0x2d469c0] Frame num gap 11 9
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[Homebridge] Last message repeated 2 times
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[Homebridge] [h264 @ 0x2d469c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
[Homebridge] Last message repeated 5 times
[Homebridge] [rtsp @ 0x2d40270] All info found
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.333333 0.019569
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.416667 0.015353
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.500000 0.011647
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.583333 0.008453
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.666667 0.005769
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.750000 0.003596
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.833333 0.001935
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.916667 0.000784
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 30.000000 0.000144
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 60.000000 0.000578
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 120.000000 0.002311
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 240.000000 0.009245
[Homebridge] [rtsp @ 0x2d40270] rfps: 29.970030 0.000316
[Homebridge] Last message repeated 1 times
[Homebridge] [rtsp @ 0x2d40270] rfps: 59.940060 0.001263
[Homebridge] Last message repeated 1 times
[Homebridge] Input #0, rtsp, from 'rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA':
[Homebridge] Duration: N/A, start: 0.000000, bitrate: N/A
[Homebridge] Stream #0:0, 18, 1/16000: Audio: aac (LC), 16000 Hz, mono, fltp
[Homebridge] Stream #0:1, 33, 1/90000: Video: h264 (Baseline), 1 reference frame, yuv420p(tv, progressive, left), 640x480 [SAR 1:1 DAR 4:3], 0/1, 29.97 fps, 30 tbr, 90k tbn, 59.94 tbc
[Homebridge] Successfully opened the file.
[Homebridge] Parsing a group of options: output url srtp://192.168.1.20:55084?rtcpport=55084&localrtcpport=55084&pkt_size=1316.
[Homebridge] Applying option map (set input stream mapping) with argument 1.
[Homebridge] Invalid input file index: 1.
[Homebridge] [5/29/2020, 3:10:30 PM] [Camera-ffmpeg] ERROR: FFmpeg exited with code 1
```

**Homebridge Config:**

```        {
            "cameras": [
                {
                    "uploader": false,
                    "videoConfig": {
                        "maxWidth": 640,
                        "audio": true,
                        "debug": true,
                        "mapaudio": "0",
                        "vflip": true,
                        "mapvideo": "1",
                        "maxHeight": 480,
                        "maxFPS": 29,
                        "source": "-re -i rtsp://admin:anotherpassword@192.168.1.14:554/test_VGA",
                        "additionalCommandline": "-x264-params \"intra-refresh=1:bframes=0\"",
                        "maxStreams": 2,
                        "hflip": true,
                        "maxBitrate": 500,
                        "stillImageSource": "-i http://admin:anotherpassword@192.168.1.14/cgi-bin/img-d1.cgi"
                    },
                    "name": "GarageCam",
                }
            ],
            "plugin_map": {
                "plugin_name": "homebridge-camera-ffmpeg"
            },
            "name": "Camera-ffmpeg",
            "platform": "Camera-ffmpeg"
        }
```

**Screenshots:**


**Environment:**

* **Node.js Version**: v12.14.1
* **NPM Version**: 6.13.4
* **Homebridge Version**: 0.4.50
* **Homebridge Camera FFmpeg Version**: 1.22
* **Homebridge Config UI X Plugin Version**:
* **Operating System**: Raspbian