marcoraddatz / homebridge-docker

Dockerized Homebridge. No plugins pre-defined, hassle-free setup. Read instructions!
Apache License 2.0
128 stars 47 forks source link

Install ffmpeg #4

Closed benzman81 closed 7 years ago

benzman81 commented 7 years ago

To use homebridge-camera-ffmpeg I need ffmpeg on the image. Could you pre-install it? The following lines where neded:

echo 'deb http://ftp.uk.debian.org/debian jessie-backports main' >> /etc/apt/sources.list

apt-get update

apt-get -y install ffmpeg

Tried it in the install.sh, but somehow it didn't work.

marcoraddatz commented 7 years ago

I wanted to keep the image as slim as possible, that's why I removed all unused parts. Have you tried to install it via install.sh or via DSM terminal?

benzman81 commented 7 years ago

Yeah, the install.sh didnt work with lines above. Maybe beause executed as separate SH script. Using a terminal on the docker image the lines above work.

marcoraddatz commented 7 years ago

Thank you. Exactly what I expected and you were right :)

Can you try it again (newest develop build, some minutes ago)? The script now gets executed as root, so I was able to install all dependencies via install.sh.

benzman81 commented 7 years ago

Almost same errors:

Updating Homebridge. /root/.homebridge/package.json not found. Installing plugins from /root/.homebridge/install.sh. E: Invalid operation update Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package ffmpeg

marcoraddatz commented 7 years ago

I'm sorry, I cannot reproduce this error. Following code worked for me:

#!/bin/bash

whoami
echo 'deb http://ftp.uk.debian.org/debian jessie-backports main' >> /etc/apt/sources.list
apt-get update
apt-get -y install ffmpeg
ffmpeg

"root" is being printed and ffmpeg can be called: "ffmpeg version 3.2.2-1~bpo8+1 Copyright (c) 2000-2016 the FFmpeg developers".

Possible error: Is the install.sh called via bash and also uses a bash shebang? I updated this some hours ago and it might not have been obvious.

benzman81 commented 7 years ago

I doublecheck.

benzman81 commented 7 years ago

Seems to be an encoding issue. Since I create and edit the file via windows shared folder, the line endings have been wrong. Converted to unix and now it seems to work.

benzman81 commented 7 years ago

Just a side note. Since installing ffmpeg on every start takes pretty long I decided to fork your repo and add the code to the dockerfile to save start time ;-)

marcoraddatz commented 7 years ago

I'm curious: Why do you restart it that often? For development?

benzman81 commented 7 years ago

Mostly for development or if I want to test plugins. And every night it restarts, too.