moritzmhmk / homebridge-camera-rpi

raspberry pi camera plugin for homebridge
MIT License
159 stars 29 forks source link

Change source #68

Open Saku241 opened 4 years ago

Saku241 commented 4 years ago

Hello !

I used to use home ridge-camera-ffmpeg but I got an issue where I couldn’t have the audio from my camera

Id like to ask is it possible to change video source because mine is at /dev/video2/ and is it possible to have audio on HomeKit when live viewing ?

Here is an exemple of a ffmpeg command for me to have a video file with sound working in it :


ffmpeg -re -ar 44100 -ac 1 -f alsa -i hw:1 -f v4l2 -c:v h264 -r 30 -s 1280x720 -itsoffset 0.5 -i /dev/video2 -copyinkf -codec:v copy -codec:a aac -ab 128k -g 10 -t 15 test.mp4

And my config with camera-ffmpeg was that but I was unable to have audio working :


{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "description": "Homebridge",
    "platforms": [{
        "platform": "Camera-ffmpeg",
        "cameras": [{
            "name": "Camera Surveillance",
            "model": "MotionEye",
            "videoConfig": {
                "source": "-re -ar 44100 -ac 1 -f alsa -i plughw:1,0 -f v4l2 -c:v h264 -i /dev/video2 -codec:v copy -ab 128k -g 10",
                "stillImageSource": "-re -f v4l2 -i /dev/video2",
                "vcodec": "copy",
                "maxStreams": 1,
                "maxWidth": 1280,
                "maxHeight": 720,
                "maxFPS": 15,
                "audio": true,
                "acodec": "aac",
                "mapvideo": "1,0",
                "mapaudio": "0,0",
                "debug": true
            }
        }]
    }]
}

Thanks for your help !