FFmpeg exited with code 1
Getting an error from ffmpeg but I cannot figure out what is really causing a code 1 exit.

When I try to run the ffmpeg command from the terminal it works perfectly.

Here is the ffmpeg command generated but the plugin and works fine when run from the terminal.

```
ffmpeg -re -i "rtsp://username:password@192.168.1.28:554/live/ch00_1" -map 0:0 -vcodec libx264 -pix_fmt yuv420p -r 10 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -maxrate 299k -payload_type 99 -ssrc 11697191 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params pg1/hpQHmNazokuBM4w+/4kDczM3bfQtjWgXQTDN "srtp://192.168.1.202:63855?rtcpport=63855&localrtcpport=63855&pkt_size=1316" -map 0:1 -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 1848011 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params rpZzU9cGR8sdAF6G7uzKLOrpb1ee1tgySxn4Nez0 "srtp://192.168.1.202:52756?rtcpport=52756&localrtcpport=52756&pkt_size=1316" -loglevel debug out.flv 2> out.txt
```

This is my config

```
{
            "videoProcessor": "ffmpeg",
            "debug": true,
            "cameras": [
                {
                    "name": "Camera UI",
                    "active": true,
                    "videoConfig": {
                        "source": "-re -i rtsp://username:password@192.168.1.28:554/live/ch00_1",
                        "maxStreams": 2,
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 10,
                        "maxBitrate": 300,
                        "vcodec": "libx264",
                        "packetSize": 1316,
                        "audio": true
                    }
                }
            ],
            "platform": "CameraUI"
        }
```

Here is the log generated in homebridge when the streaming starts

```
[9/28/2020, 2:04:58 AM] [CameraUI] [INFO] Start streaming video from Spy Camera UI with 1280x720@299kBit
2020-09-27T16:04:58.194Z CameraUI Camera UI: ffmpeg -re -i rtsp://username:password@192.168.1.28:554/live/ch00_1 -map 0:0 -vcodec libx264 -pix_fmt yuv420p -r 10 -f rawvideo -tune zerolatency -vf scale=1280:720 -b:v 299k -bufsize 299k -maxrate 299k -payload_type 99 -ssrc 11697191 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params pg1/hpQHmNazokuBM4w+/4kDczM3bfQtjWgXQTDN srtp://192.168.1.201:63855?rtcpport=63855&localrtcpport=63855&pkt_size=1316 -map 0:1 -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 1848011 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params rpZzU9cGR8sdAF6G7uzKLOrpb1ee1tgySxn4Nez0 srtp://192.168.1.201:52756?rtcpport=52756&localrtcpport=52756&pkt_size=1316 -loglevel debug
2020-09-27T16:04:58.253Z CameraUI ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1-with-options_3 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash --disable-libjack --disable-indev=jack --enable-opencl --enable-videotoolbox --disable-htmlpages --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfdk-aac --enable-libgme --enable-libgsm --enable-libmodplug --enable-libopenh264 --enable-libopenjpeg --enable-librav1e --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtesseract --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libwavpack --enable-libwebp --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-openssl --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb

2020-09-27T16:04:58.253Z CameraUI   libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Splitting the commandline.
Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-i' ... matched as input url with argument 'rtsp://username:password@192.168.1.28:554/live/ch00_1'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:0'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'yuv420p'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with argument '10'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rawvideo'.
Reading option '-tune' ...
2020-09-27T16:04:58.254Z CameraUI  matched as AVOption 'tune' with argument 'zerolatency'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=1280:720'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '299k'.
Reading option '-bufsize' ...
2020-09-27T16:04:58.254Z CameraUI  matched as AVOption 'bufsize' with argument '299k'.
Reading option '-maxrate' ...
2020-09-27T16:04:58.255Z CameraUI  matched as AVOption 'maxrate' with argument '299k'.
Reading option '-payload_type' ...
2020-09-27T16:04:58.255Z CameraUI  matched as AVOption 'payload_type' with argument '99'.
Reading option '-ssrc' ...
2020-09-27T16:04:58.256Z CameraUI  matched as AVOption 'ssrc' with argument '11697191'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rtp'.
Reading option '-srtp_out_suite' ...
2020-09-27T16:04:58.256Z CameraUI  matched as AVOption 'srtp_out_suite' with argument 'AES_CM_128_HMAC_SHA1_80'.
Reading option '-srtp_out_params' ...
2020-09-27T16:04:58.256Z CameraUI  matched as AVOption 'srtp_out_params' with argument 'pg1/hpQHmNazokuBM4w+/4kDczM3bfQtjWgXQTDN'.
Reading option 'srtp://192.168.1.201:63855?rtcpport=63855&localrtcpport=63855&pkt_size=1316' ... matched as output url.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:1'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'.
Reading option '-profile:a' ... matched as option 'profile' (set profile) with argument 'aac_eld'.
Reading option '-flags' ...
2020-09-27T16:04:58.257Z CameraUI  matched as AVOption 'flags' with argument '+global_header'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '16k'.
Reading option '-b:a' ...
2020-09-27T16:04:58.257Z CameraUI  matched as option 'b' (video bitrate (please use -b:v)) with argument '24k'.
Reading option '-bufsize' ...
2020-09-27T16:04:58.257Z CameraUI  matched as AVOption 'bufsize' with argument '24k'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '1'.
Reading option '-payload_type' ...
2020-09-27T16:04:58.257Z CameraUI  matched as AVOption 'payload_type' with argument '110'.
Reading option '-ssrc' ...
2020-09-27T16:04:58.258Z CameraUI  matched as AVOption 'ssrc' with argument '1848011'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'rtp'.
Reading option '-srtp_out_suite' ...
2020-09-27T16:04:58.258Z CameraUI  matched as AVOption 'srtp_out_suite' with argument 'AES_CM_128_HMAC_SHA1_80'.
Reading option '-srtp_out_params' ...
2020-09-27T16:04:58.258Z CameraUI  matched as AVOption 'srtp_out_params' with argument 'rpZzU9cGR8sdAF6G7uzKLOrpb1ee1tgySxn4Nez0'.
Reading option 'srtp://192.168.1.201:52756?rtcpport=52756&localrtcpport=52756&pkt_size=1316' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.

2020-09-27T16:04:58.258Z CameraUI Parsing a group of options: input url rtsp://linkrjr:Password2@192.168.1.28:554/live/ch00_1.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: rtsp://username:password@192.168.1.28:554/live/ch00_1.

2020-09-27T16:04:58.260Z CameraUI [tcp @ 0x7f9660404640] No default whitelist set

2020-09-27T16:04:58.260Z CameraUI [tcp @ 0x7f9660404640] Original list of addresses:
[tcp @ 0x7f9660404640] Address 192.168.1.28 port 554
[tcp @ 0x7f9660404640] Interleaved list of addresses:
[tcp @ 0x7f9660404640] Address 192.168.1.28 port 554
[tcp @ 0x7f9660404640] Starting connection attempt to 192.168.1.28 port 554

2020-09-27T16:04:58.278Z CameraUI [tcp @ 0x7f9660404640] Successfully connected to 192.168.1.28 port 554

2020-09-27T16:04:58.339Z CameraUI [rtsp @ 0x7f9662008200] SDP:
v=0
s=streamed by the macro-video rtsp server
t=0 0
a=control:*
a=range:npt=0-
a=x-qt-text-nam:streamed by the macro-video rtsp server
c=IN IP4 0.0.0.0
m=video 0 RTP/AVP 96
b=AS:500
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=TeAo;packetization-mode=1;sprop-parameter-sets=J03gKI1oBQBboQAAAwABAAADAGQPFCKg,KO4BNJI=
a=control:track1


2020-09-27T16:04:58.339Z CameraUI Failed to parse interval end specification ''
[rtsp @ 0x7f9662008200] video codec set to: h264
[rtsp @ 0x7f9662008200] RTP Packetization Mode: 1
[rtsp @ 0x7f9662008200] Extradata set to 0x7f9661204d90 (size: 37)

2020-09-27T16:04:58.340Z CameraUI [rtp @ 0x7f9661204c00] No default whitelist set

2020-09-27T16:04:58.340Z CameraUI [udp @ 0x7f96612052c0] No default whitelist set

2020-09-27T16:04:58.340Z CameraUI [udp @ 0x7f96612052c0] end receive buffer size reported is 393216

2020-09-27T16:04:58.340Z CameraUI [udp @ 0x7f9661205380] No default whitelist set

2020-09-27T16:04:58.340Z CameraUI [udp @ 0x7f9661205380] end receive buffer size reported is 393216

2020-09-27T16:04:58.383Z CameraUI [rtsp @ 0x7f9662008200] setting jitter buffer size to 500

2020-09-27T16:04:58.383Z CameraUI [rtsp @ 0x7f9662008200] hello state=0

2020-09-27T16:04:58.406Z CameraUI [h264 @ 0x7f966200be00] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x7f966200be00] nal_unit_type: 8(PPS), nal_ref_idc: 1

2020-09-27T16:04:58.569Z CameraUI [h264 @ 0x7f966200be00] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x7f966200be00] nal_unit_type: 8(PPS), nal_ref_idc: 1

2020-09-27T16:04:58.691Z CameraUI [h264 @ 0x7f966200be00] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x7f966200be00] nal_unit_type: 8(PPS), nal_ref_idc: 1

2020-09-27T16:04:58.692Z CameraUI [h264 @ 0x7f966200be00] nal_unit_type: 5(IDR), nal_ref_idc: 1

2020-09-27T16:04:58.692Z CameraUI [h264 @ 0x7f966200be00] Format yuv420p chosen by get_format().
[h264 @ 0x7f966200be00] Reinit context to 1280x720, pix_fmt: yuv420p

2020-09-27T16:04:58.736Z CameraUI [h264 @ 0x7f966200be00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 1

2020-09-27T16:05:00.488Z CameraUI     Last message repeated 5 times
[rtsp @ 0x7f9662008200] All info found
[rtsp @ 0x7f9662008200] rfps: 24.666667 0.016347
[rtsp @ 0x7f9662008200] rfps: 24.750000 0.009251
    Last message repeated 1 times
[rtsp @ 0x7f9662008200] rfps: 24.833333 0.004214

2020-09-27T16:05:00.488Z CameraUI     Last message repeated 1 times
[rtsp @ 0x7f9662008200] rfps: 24.916667 0.001237
[rtsp @ 0x7f9662008200] rfps: 25.000000 0.000319
[rtsp @ 0x7f9662008200] rfps: 25.083333 0.001460
    Last message repeated 1 times
[rtsp @ 0x7f9662008200] rfps: 25.166667 0.004660
    Last message repeated 1 times
[rtsp @ 0x7f9662008200] rfps: 25.250000 0.009919
    Last message repeated 1 times
[rtsp @ 0x7f9662008200] rfps: 25.333333 0.017237
[rtsp @ 0x7f9662008200] rfps: 50.000000 0.001275

2020-09-27T16:05:00.488Z CameraUI Input #0, rtsp, from 'rtsp://username:password@192.168.1.28:554/live/ch00_1':
  Metadata:
    title           : streamed by the macro-video rtsp server
  Duration: N/A, start: 0.460000, bitrate: N/A

2020-09-27T16:05:00.488Z CameraUI     Stream #0:0, 28, 1/90000: Video: h264 (Main), 1 reference frame, yuv420p(progressive, left), 1280x720, 0/1, 50 fps, 25 tbr, 90k tbn, 100 tbc
Successfully opened the file.
Parsing a group of options: output url srtp://192.168.1.201:63855?rtcpport=63855&localrtcpport=63855&pkt_size=1316.
Applying option map (set input stream mapping) with argument 0:0.

2020-09-27T16:05:00.488Z CameraUI Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 10.
Applying option f (force format) with argument rawvideo.
Applying option vf (set video filters) with argument scale=1280:720.
Applying option b:v (video bitrate (please use -b:v)) with argument 299k.
Applying option f (force format) with argument rtp.
Successfully parsed a group of options.
Opening an output file: srtp://192.168.1.201:63855?rtcpport=63855&localrtcpport=63855&pkt_size=1316.

2020-09-27T16:05:00.489Z CameraUI [srtp @ 0x7f9660504ec0] No default whitelist set

2020-09-27T16:05:00.489Z CameraUI [rtp @ 0x7f966050a180] No default whitelist set
[udp @ 0x7f966050a400] No default whitelist set

2020-09-27T16:05:00.489Z CameraUI [udp @ 0x7f966050a4c0] No default whitelist set

2020-09-27T16:05:00.489Z CameraUI Successfully opened the file.
Parsing a group of options: output url srtp://192.168.1.201:52756?rtcpport=52756&localrtcpport=52756&pkt_size=1316.
Applying option map (set input stream mapping) with argument 0:1.
Stream map '0:1' matches no streams.
To ignore this, add a trailing '?' to the map.

2020-09-27T16:05:00.489Z CameraUI [AVIOContext @ 0x7f966050a580] Statistics: 0 seeks, 0 writeouts

[9/28/2020, 2:05:00 AM] [CameraUI] [ERROR] Spy Camera UI: FFmpeg exited with code 1
```

Any help is very appreciated. 


