Giter Site home page Giter Site logo

Comments (15)

oznu avatar oznu commented on May 22, 2024

Hi Michael,

Additional packages can be installed using the -e PACKAGES environment variable.

-e PACKAGES - Additional packages to install (comma separated, no spaces) e.g. -e PACKAGES=ffmpeg,openssh

For example:

docker run --net=host -v <path/to/config>:/config -e "PACKAGES=ffmpeg" oznu/homebridge

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

Hi Oznu,

I'm trying to get ffmpeg going, I followed the instruction and manage to get cameras show up on Accessories but there's no feed.

I'm getting the following error, please see below - which tells me ffmpeg is not installed in the right path.

I just want to confirm, is this syntax right...

docker run --net=host -v /home/pi/homebridge/config:/config -e "PACKAGES=ffmpeg" oznu/homebridge

Error: standard_init_linux.go:195: exec user process caused "exec format error"

RPI CONFIG PATH
/home/pi/homebridge/config

ERROR MESSAGE

homebridge_1 | events.js:183 homebridge_1 | throw er; // Unhandled 'error' event homebridge_1 | ^ homebridge_1 | Error: spawn ffmpeg ENOENT homebridge_1 | at _errnoException (util.js:1022:11) homebridge_1 | at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)

from docker-homebridge.

oznu avatar oznu commented on May 22, 2024

What plugin are you using? ffmpeg gets installed to /usr/bin/ffmpeg.

/homebridge # ffmpeg
ffmpeg version 3.2.9 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Alpine 6.3.0)
  configuration: --prefix=/usr --enable-avresample --enable-avfilter --enable-gnutls --enable-gpl --enable-libmp3lame --enable-librtmp --enable-libvorbis --enable-libvpx --enable-libxvid --enable-libx264 --enable-libx265 --enable-libtheora --enable-libv4l2 --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-x11grab --disable-stripping --disable-static --enable-vaapi --enable-libopus --disable-debug
  libavutil      55. 34.101 / 55. 34.101
  libavcodec     57. 64.101 / 57. 64.101
  libavformat    57. 56.101 / 57. 56.101
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
Hyper fast Audio and Video encoder
/homebridge # which ffmpeg
/usr/bin/ffmpeg

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

homebridge-camera-ffmpeg

I got the plugin installed but can't get ffmpeg install in the container

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

from docker-homebridge.

oznu avatar oznu commented on May 22, 2024

It will, but you should only do that if running on a Raspberry Pi. You didn't mentioned which platform you were running which is why I removed my initial responses as I had just made an assumption.

This error is usually caused by running the wrong architecture:

Error: standard_init_linux.go:195: exec user process caused "exec format error"

Which led me to believe you were running on a Pi.

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

from docker-homebridge.

oznu avatar oznu commented on May 22, 2024

Make sure your running with the raspberry-pi tag and it should work:

docker run --net=host -v /home/pi/homebridge/config:/config -e "PACKAGES=ffmpeg" oznu/homebridge:raspberry-pi

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

I gave it a shot but I'm still have the same error (Error: spawn ffmpeg ENOENT), I'm confused as to why this is happening considering I got it installed in the right container i think....

homebridge_1  |                        
homebridge_1  |     ┌────────────┐     
homebridge_1  |     │ 031-45-154 │     
homebridge_1  |     └────────────┘     
homebridge_1  |                        
homebridge_1  | [2018-1-18 15:44:25] Homebridge is running on port 51826.
homebridge_1  | [2018-1-18 15:44:25] Street is running on port 45885.
homebridge_1  | Snapshot -i http://192.168.1.64/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=abcd123456&user=admin&password=0162855518 -t 1 -s 480x270 -f image2 -
homebridge_1  | events.js:183
homebridge_1  |       throw er; // Unhandled 'error' event
homebridge_1  |       ^
homebridge_1  | 
homebridge_1  | Error: spawn ffmpeg ENOENT
homebridge_1  |     at _errnoException (util.js:1022:11)
homebridge_1  |     at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
homebridge_1  |     at onErrorNT (internal/child_process.js:372:16)
homebridge_1  |     at _combinedTickCallback (internal/process/next_tick.js:138:11)
homebridge_1  |     at process._tickCallback (internal/process/next_tick.js:180:9)
homebridge_1  | *** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
homebridge_1  | *** WARNING *** Please fix your application to use the native API of Avahi!
homebridge_1  | *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
homebridge_1  | *** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
homebridge_1  | *** WARNING *** Please fix your application to use the native API of Avahi!
homebridge_1  | *** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
homebridge_1  | [2018-1-18 15:46:50] Loaded plugin: homebridge-camera-ffmpeg
homebridge_1  | [2018-1-18 15:46:50] Registering platform 'homebridge-camera-ffmpeg.Camera-ffmpeg'
homebridge_1  | [2018-1-18 15:46:50] ---
homebridge_1  | [2018-1-18 15:46:50] Loaded plugin: homebridge-dummy
homebridge_1  | [2018-1-18 15:46:50] Registering accessory 'homebridge-dummy.DummySwitch'
homebridge_1  | [2018-1-18 15:46:50] ---
homebridge_1  | [2018-1-18 15:46:50] Loaded plugin: homebridge-config-ui-x
homebridge_1  | [2018-1-18 15:46:50] Registering platform 'homebridge-config-ui-x.config'
homebridge_1  | [2018-1-18 15:46:50] ---
homebridge_1  | [2018-1-18 15:46:50] Loaded config.json with 0 accessories and 1 platforms.
homebridge_1  | [2018-1-18 15:46:50] ---
homebridge_1  | [2018-1-18 15:46:50] Loading 1 platforms...
homebridge_1  | [2018-1-18 15:46:50] [Camera-ffmpeg] Initializing Camera-ffmpeg platform...
homebridge_1  | Setup Payload:
homebridge_1  | X-HM://0023ISYWYK25O
homebridge_1  | Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

from docker-homebridge.

oznu avatar oznu commented on May 22, 2024

I have this tested this and it's working.

# get the latest image
docker pull oznu/homebridge:raspberry-pi

# start container - add your local volume to the command
docker run -d --name=homebridge -e "PACKAGES=ffmpeg" --net=host oznu/homebridge:raspberry-pi

# add ffmpeg plugin
docker exec homebridge yarn add homebridge-camera-ffmpeg

Set this config.json, using a public rtsp stream for testing since I don't have any local feeds:

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:12",
        "port": 51826,
        "pin": "031-45-150"
    },
    "accessories": [],
    "platforms": [
        {
            "platform": "Camera-ffmpeg",
            "cameras": [
                {
                    "name": "Test Camera",
                    "videoConfig": {
                        "source": "-re -i rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov",
                        "stillImageSource": "-i https://www.wowza.com/images/playvideoBtn.jpg",
                        "maxStreams": 2,
                        "maxWidth": 640,
                        "maxHeight": 480,
                        "maxFPS": 10
                    }
                }
            ]
        }
    ]
}

Restart the container, add camera to Home app, view video feed.

It's very very slow on my Raspberry Pi 3.

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

I don't know why I'm still getting Error: spawn ffmpeg ENOENT. I did everything right i think. I ran the following again and it's telling me all installed...

#get the latest image
docker pull oznu/homebridge:raspberry-pi

#start container - add your local volume to the command
docker run -d --name=homebridge -e "PACKAGES=ffmpeg" --net=host oznu/homebridge:raspberry-pi

#add ffmpeg plugin
docker exec homebridge yarn add homebridge-camera-ffmpeg


permitted by applicable law.
Last login: Fri Jan 19 09:23:48 2018 from 192.168.1.76

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~ $ cd /home/pi/homebridge
pi@raspberrypi:~/homebridge $ docker pull oznu/homebridge:raspberry-pi
raspberry-pi: Pulling from oznu/homebridge
Digest: sha256:da139868db7d954f4a6beb2abdfb1a166c95a38f3ac4ebaee0195f6ad0895ab4
Status: Image is up to date for oznu/homebridge:raspberry-pi
pi@raspberrypi:~/homebridge $ docker run -d --name=homebridge -e "PACKAGES=ffmpeg" --net=host oznu/homebridge:raspberry-pi
docker: Error response from daemon: Conflict. The container name "/homebridge" is already in use by container "c62093131f937f2cd03d4335e80d602482055f4a1db6ade8b82a29b8c2a92535". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
pi@raspberrypi:~/homebridge $ docker exec homebridge yarn add homebridge-camera-ffmpeg
Error response from daemon: Container c62093131f937f2cd03d4335e80d602482055f4a1db6ade8b82a29b8c2a92535 is not running
pi@raspberrypi:~/homebridge $ docker exec homebridge yarn add homebridge-camera-ffmpeg
Error response from daemon: Container c62093131f937f2cd03d4335e80d602482055f4a1db6ade8b82a29b8c2a92535 is not running
pi@raspberrypi:~/homebridge $ docker-compose exec homebridge yarn add homebridge-camera-ffmpeg
yarn add v1.3.2
warning package.json: No license field
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning [email protected]: The engine "homebridge" appears to be invalid.
warning [email protected]: The engine "homebridge" appears to be invalid.
warning [email protected]: The engine "homebridge" appears to be invalid.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 1 new dependency.
└─ [email protected]
warning No license field
Done in 7.41s.
pi@raspberrypi:~/homebridge $ 

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

Hi @oznu I have a few noob questions...

  1. should I be running the following syntax in pi@raspberrypi:~/homebridge or pi@raspberrypi:~ $directory
#get the latest image
docker pull oznu/homebridge:raspberry-pi

#start container - add your local volume to the command
docker run -d --name=homebridge -e "PACKAGES=ffmpeg" --net=host oznu/homebridge:raspberry-pi

#add ffmpeg plugin
docker exec homebridge yarn add homebridge-camera-ffmpeg
  1. PACKAGES=ffmpeg does this install the ffmpeg or do I have to install ffmpeg in the raspberry pi root directory on the side?

  2. I notice the > add ffmpeg syntax is different from what's listed in your general tutorial docker exec homebridge yarn add homebridge-camera-ffmpeg and docker-compose exec is this intentional?

basically, you have excluded "-compose " in your previous post.

from docker-homebridge.

oznu avatar oznu commented on May 22, 2024

Hi @jeylites,

docker and docker-compose are two different methods to get the same docker container running, but I think this is where the issue is.

Try this.

Clean up your existing setup:

docker rm -f $(docker ps -aq)
docker system prune -f

Follow the guide to setup using docker-compose exactly:

https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Raspberry-Pi#3-create-docker-compose-manifest

The only thing you need to adjust is the docker-compose.yml manifest, which needs to include the PACKAGES environment variable:

version: '2'
services:
  homebridge:
    image: oznu/homebridge:raspberry-pi
    restart: always
    network_mode: host
    volumes:
      - ./config:/homebridge
    environment:
      - PGID=1000
      - PUID=1000
      - PACKAGES=ffmpeg

from docker-homebridge.

jeylites avatar jeylites commented on May 22, 2024

Hi @oznu

Sorry for the delay in writing back. I followed your instructions and got it working. You are right, It's very slow on a Raspberry Pi 3.

Just wondering, what kind of hardware you will suggest running this setup on? - ffmpeg & oznu docker homebridge. I would like to try to see the performance.

The cleanup tip is a big saver. Previously, I have been re-imaging my SD to start all over. Very painful process sigh

Clean up your existing setup:

docker rm -f $(docker ps -aq)
docker system prune -f

The other thing is, what will be the syntax to remove a container from docker?

THANK YOU!

from docker-homebridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.