Within docker container, ffmpeg command failure from homebridge but works on cli
<!-- You must use the issue template below -->

**Describe The Problem:**
<!-- A clear and concise description of what the bug is. -->
I'm working on getting the ffmpeg h264_v4l2m2m codec working within docker-homebridge (specifically using oznu/homebridge:debian-no-avahi-raspberry-pi as a base). In doing so I've noticed something strange and maybe someone could provide input. First, to enable to codec I need to attach /dev/video{10,11,12} to the container. If I am running the container with PUID=0 & PGID=0 I am able to get output from ffmpeg going through the hardware encoders (patches missing from the currently included version of ffmpeg make the output have a green tint currently using ffmpeg 4.3 or greater fixes that) and I see video from the camera in the home app.

If I attempt to run using non root by using PUID=1000 & PGID=1000 things get interesting. First, I need to add the root & abc user to the video group which I've done with both a new docker image or also trying the startup.sh. If I exec into the container both the abc & root users have the video group. If I exec into the container I am able to see the video group on both users. Also, if while in the shell I run ffmpeg commands I am successfully able to utilize the codec using either user. If I return to homebridge and open the configured camera in homekit I get an ffmpeg failure in the homebridge logs.

Is there something special about how ffmpeg is spawned or exec'ed from node? I'm trying to figure out what is different here. I wasn't sure this was the best place to report this but since the failure only seems to happen when node calls out to ffmpeg it might be the best place to start.

**To Reproduce:**
<!-- Steps to reproduce the behavior. -->

mkdir build && cd build
Create Dockerfile using these contents:
```
FROM oznu/homebridge:debian-no-avahi-raspberry-pi
RUN usermod -aG video abc \ 
   && usermod -aG video root
```
docker build -t groupadd .

cd ..
mkdir homebridge && cd homebridge
mkdir config

Create config/startup.sh using these contents:
```
#!/bin/sh

#
# Docker Homebridge Custom Startup Script - oznu/homebridge
#
# This script can be used to customise the environment and will be executed as
# the root user each time the container starts.
#
# If using this to install plugins DO NOT use the global flag (-g).
#
# Example installing homebridge plugin:
#
# npm install homebridge-hue
#
# Example installing packages using default image (Alpine Linux):
#
# apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev
#
# If you're running a debian based version of this container please use apt-get to install packages.
#
#groupadd -g 44 video
usermod -aG video abc
usermod -aG video root
# usermod -aG 44 abc
```

Create docker-compose.yml using these contents:
```
version: '2'
services:
  homebridge:
          #image: oznu/homebridge:raspberry-pi
          #image: oznu/homebridge:debian-no-avahi-raspberry-pi
    image: groupadd:latest
    restart: always
    network_mode: host
    volumes:
      - ./config:/homebridge
    environment:
      - PGID=1000
      - PUID=1000
        #- PGID=0
        #- PUID=0
      - HOMEBRIDGE_CONFIG_UI=1
      - HOMEBRIDGE_CONFIG_UI_PORT=8080
    devices:
      - /dev/video10:/dev/video10
      - /dev/video11:/dev/video11
      - /dev/video12:/dev/video12
    group_add:
      - video
      - 44
```

docker-compose up -d

Wait for for containers to create...

docker-compose exec homebridge /bin/sh

In the below run, I picked a random MJPEG camera I found online to use as the source since this should be accessible to anyone trying to replicate this issue.

```
# id root
uid=0(root) gid=0(root) groups=0(root),44(video)
# id abc
uid=1000(abc) gid=1000(abc) groups=1000(abc),44(video),100(users)
# ls -l /dev/video*
crw-rw---- 1 root video 81, 4 Sep  1 00:04 /dev/video10
crw-rw---- 1 root video 81, 5 Sep  1 00:04 /dev/video11
crw-rw---- 1 root video 81, 6 Sep  1 00:04 /dev/video12
# sudo -u root /homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -r 4 -i 'http://50.211.214.94/mjpg/video.mjpg' -an -sn -dn -vcodec h264_v4l2m2m -pix_fmt yuv420p -color_range mpeg -b:v 1500k /homebridge/root.mp4
ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  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-indev=alsa --enable-outdev=alsa
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mjpeg, from 'http://50.211.214.94/mjpg/video.mjpg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1280x800 [SAR 1:1 DAR 8:5], 4 fps, 4 tbr, 1200k tbn, 4 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_v4l2m2m))
Press [q] to stop, [?] for help
[swscaler @ 0x2e3fab0] deprecated pixel format used, make sure you did set range correctly
[h264_v4l2m2m @ 0x2e140a0] driver 'bcm2835-codec' on card 'bcm2835-codec-isp'
[h264_v4l2m2m @ 0x2e140a0] driver 'bcm2835-codec' on card 'bcm2835-codec-encode'
[h264_v4l2m2m @ 0x2e140a0] Using device /dev/video11
[h264_v4l2m2m @ 0x2e140a0] driver 'bcm2835-codec' on card 'bcm2835-codec-encode'
[h264_v4l2m2m @ 0x2e140a0] Failed to set number of B-frames
    Last message repeated 1 times
[h264_v4l2m2m @ 0x2e140a0] Failed to set header mode
[h264_v4l2m2m @ 0x2e140a0] Failed to set gop size
[h264_v4l2m2m @ 0x2e140a0] h264 profile not found
[h264_v4l2m2m @ 0x2e140a0] Encoder adjusted: qmin (0), qmax (51)
[h264_v4l2m2m @ 0x2e140a0] Failed to set minimum video quantizer scale
[h264_v4l2m2m @ 0x2e140a0] Failed to set maximum video quantizer scale
Output #0, mp4, to '/homebridge/root.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (h264_v4l2m2m) (avc1 / 0x31637661), yuv420p(tv), 1280x800 [SAR 1:1 DAR 8:5], q=2-31, 1500 kb/s, 4 fps, 16384 tbn, 4 tbc
    Metadata:
      encoder         : Lavc58.54.100 h264_v4l2m2m
[mp4 @ 0x2e13780] Non-monotonous DTS in output stream 0:0; previous: 208896, current: 0; changing to 208897. This may result in incorrect timestamps in the output file.
frame=   52 fps=5.8 q=-0.0 Lsize=     318kB time=00:00:12.75 bitrate= 204.6kbits/s speed=1.42x    
video:317kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.307939%
# sudo -u abc /homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -f mjpeg -r 4 -i 'http://50.211.214.94/mjpg/video.mjpg' -an -sn -dn -vcodec h264_v4l2m2m -pix_fmt yuv420p -color_range mpeg -b:v 1500k /homebridge/abc.mp4
ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  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-indev=alsa --enable-outdev=alsa
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mjpeg, from 'http://50.211.214.94/mjpg/video.mjpg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1280x800 [SAR 1:1 DAR 8:5], 4 fps, 4 tbr, 1200k tbn, 4 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_v4l2m2m))
Press [q] to stop, [?] for help
[swscaler @ 0x3cdd890] deprecated pixel format used, make sure you did set range correctly
[h264_v4l2m2m @ 0x3cb30a0] driver 'bcm2835-codec' on card 'bcm2835-codec-isp'
[h264_v4l2m2m @ 0x3cb30a0] driver 'bcm2835-codec' on card 'bcm2835-codec-encode'
[h264_v4l2m2m @ 0x3cb30a0] Using device /dev/video11
[h264_v4l2m2m @ 0x3cb30a0] driver 'bcm2835-codec' on card 'bcm2835-codec-encode'
[h264_v4l2m2m @ 0x3cb30a0] Failed to set number of B-frames
    Last message repeated 1 times
[h264_v4l2m2m @ 0x3cb30a0] Failed to set header mode
[h264_v4l2m2m @ 0x3cb30a0] Failed to set gop size
[h264_v4l2m2m @ 0x3cb30a0] h264 profile not found
[h264_v4l2m2m @ 0x3cb30a0] Encoder adjusted: qmin (0), qmax (51)
[h264_v4l2m2m @ 0x3cb30a0] Failed to set minimum video quantizer scale
[h264_v4l2m2m @ 0x3cb30a0] Failed to set maximum video quantizer scale
Output #0, mp4, to '/homebridge/abc.mp4':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (h264_v4l2m2m) (avc1 / 0x31637661), yuv420p(tv), 1280x800 [SAR 1:1 DAR 8:5], q=2-31, 1500 kb/s, 4 fps, 16384 tbn, 4 tbc
    Metadata:
      encoder         : Lavc58.54.100 h264_v4l2m2m
[mp4 @ 0x3ca4f90] Non-monotonous DTS in output stream 0:0; previous: 249856, current: 0; changing to 249857. This may result in incorrect timestamps in the output file.
frame=   62 fps=4.2 q=-0.0 Lsize=     404kB time=00:00:15.25 bitrate= 217.0kbits/s speed=1.04x    
video:403kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.253239%
```

Open camera in Homekit for streaming and get the failure below in the homebridge log.

**Logs:**
<!-- Bug reports that do not contain logs may be closed without warning. -->

```
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] Video stream requested: 1280 x 720, 30 fps, 299 kbps
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] Starting video stream: native x native, 3 fps, 299 kbps
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] Stream command: /homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i http://10.0.1.10/media/?action=stream&user=admin&pwd= -an -sn -dn -codec:v h264_v4l2m2m -pix_fmt yuv420p -color_range mpeg -r 3 -f rawvideo -b:v 299k -payload_type 99 -ssrc 8123873 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params PhBWIcwE5P3boh1UBpW5QYw+6tLrBRiBEICinH8R srtp://10.0.1.14:53463?rtcpport=53463&pkt_size=1316 -loglevel level+verbose
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info] ffmpeg version 4.2.2-d1e8be3 Copyright (c) 2000-2019 the FFmpeg developers
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [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-indev=alsa --enable-outdev=alsa
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libavutil      56. 31.100 / 56. 31.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libavcodec     58. 54.100 / 58. 54.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libavformat    58. 29.100 / 58. 29.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libavdevice    58.  8.100 / 58.  8.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libavfilter     7. 57.100 /  7. 57.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libswscale      5.  5.100 /  5.  5.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libswresample   3.  5.100 /  3.  5.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] [info]   libpostproc    55.  5.100 / 55.  5.100
[8/31/2020, 11:55:24 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [tcp @ 0x34b9280] [verbose] Starting connection attempt to 10.0.1.10 port 80
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [tcp @ 0x34b9280] [verbose] Successfully connected to 10.0.1.10 port 80
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info] Input #0, mpjpeg, from 'http://10.0.1.10/media/?action=stream&user=admin&pwd=':
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info]   Duration: N/A, bitrate: N/A
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info]     Stream #0:0: Video: mjpeg (Baseline), 1 reference frame, yuvj420p(pc, bt470bg/unknown/unknown, center), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info] Stream mapping:
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info]   Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (h264_v4l2m2m))
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info] Press [q] to stop, [?] for help
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [graph 0 input from stream 0:0 @ 0x34eeda0] [verbose] w:1920 h:1080 pixfmt:yuvj420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [auto_scaler_0 @ 0x34ed160] [verbose] w:iw h:ih flags:'bicubic' interl:0
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [format @ 0x34ecbd0] [verbose] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format'
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [swscaler @ 0x35198c0] [warning] deprecated pixel format used, make sure you did set range correctly
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [auto_scaler_0 @ 0x34ed160] [verbose] w:1920 h:1080 fmt:yuvj420p sar:1/1 -> w:1920 h:1080 fmt:yuv420p sar:1/1 flags:0x4
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [h264_v4l2m2m @ 0x34bd8f0] [error] Could not find a valid device
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [h264_v4l2m2m @ 0x34bd8f0] [error] can't configure encoder
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [error] Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [AVIOContext @ 0x34c1050] [verbose] Statistics: 0 seeks, 0 writeouts
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [AVIOContext @ 0x34c14c0] [verbose] Statistics: 148719 bytes read, 0 seeks
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] [info] Conversion failed!
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] 
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] FFmpeg exited with code: 1 and signal: null (Error)
[8/31/2020, 11:55:25 PM] [Camera FFmpeg] [Walker Cam] Stopped video stream.

```

**Homebridge Config:**

```json
{
    "bridge": {
        "name": "Homebridge ",
        "username": "",
        "port": ,
        "pin": ""
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8080,
            "auth": "form",
            "theme": "auto",
            "tempUnits": "f",
            "lang": "auto",
            "platform": "config"
        },
        {
            "name": "Camera FFmpeg",
            "interfaceName": "wlan0",
            "cameras": [
                {
                    "name": "Walker Cam",
                    "videoConfig": {
                        "source": "-i http://10.0.1.10/media/?action=stream&user=admin&pwd=",
                        "stillImageSource": "-i http://10.0.1.10/media/?action=snapshot&user=admin&pwd=",
                        "maxWidth": 0,
                        "maxHeight": 0,
                        "maxFPS": 3,
                        "maxBitrate": 600,
                        "forceMax": false,
                        "vcodec": "h264_v4l2m2m",
                        "debug": true
                    }
                }
            ],
            "platform": "Camera-ffmpeg"
        }
    ]
}
```

**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**

* **Node.js Version**: <!-- node -v -->v12.18.3
* **NPM Version**: <!-- npm -v -->v6.14.6
* **Homebridge Version**: <!-- homebridge -V -->1.1.2
* **Homebridge Camera FFmpeg Version**: v3.0.2
* **Homebridge Config UI X Plugin Version**: v4.26.0
* **Operating System**: Docker on RaspberryPi (container: oznu/homebridge:debian-no-avahi-raspberry-pi)

```
pi@raspberrypi:~/docker/homebridge $ uname -a
Linux raspberrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
```

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
