当前位置: 首页 > 软件库 > 其他开源 > 物联网 >

homebridge-camera-ffmpeg

授权协议 Apache-2.0 License
开发语言 JavaScript
所属分类 其他开源、 物联网
软件类型 开源软件
地区 不详
投 递 者 甄文彬
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Homebridge Camera FFmpeg

Homebridge Plugin Providing FFmpeg-based Camera Support

Installation

This plugin is supported under both Homebridge and HOOBS. It is highly recommended that you use either Homebridge Config UI X or the HOOBS UI to install and configure this plugin.

Manual Installation

  1. Install this plugin using: sudo npm install -g homebridge-camera-ffmpeg --unsafe-perm.
  2. Edit config.json manually to add your cameras. See below for instructions on that.

Tested configurations

Other users have been sharing configurations that work for them on our GitHub site. You may want to check that to see if anyone else has gotten your model of camera working already, or share a configuration setup that works for you.

Manual Configuration

Most Important Parameters

  • platform: (Required) Must always be set to Camera-ffmpeg.
  • name: (Required) Set the camera name for display in the Home app.
  • source: (Required) FFmpeg options on where to find and how to decode your camera's video stream. The most basic form is -i followed by your camera's URL.
  • stillImageSource: If your camera also provides a URL for a still image, that can be defined here with the same syntax as source. If not set, the plugin will grab one frame from source.

Config Example

{
  "platform": "Camera-ffmpeg",
  "cameras": [
    {
      "name": "Camera Name",
      "videoConfig": {
        "source": "-i rtsp://username:password@example.com:554",
        "stillImageSource": "-i http://example.com/still_image.jpg",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 30
      }
    }
  ]
}

Optional Parameters

  • motion: Exposes the motion sensor for this camera. This can be triggered with dummy switches, MQTT messages, or via HTTP, depending on what features are enabled in the config. (Default: false)
  • doorbell: Exposes the doorbell device for this camera. This can be triggered with dummy switches, MQTT messages, or via HTTP, depending on what features are enabled in the config. (Default: false)
  • switches: Enables dummy switches to trigger motion and/or doorbell, if either of those are enabled. When enabled there will be an additional switch that triggers the motion or doorbell event. See the project site for more detailed instructions. (Default: false)
  • motionTimeout: The number of seconds after triggering to reset the motion sensor. Set to 0 to disable resetting of motion trigger for MQTT or HTTP. (Default: 1)
  • motionDoorbell: Rings the doorbell when motion is activated. This allows for motion alerts to appear on Apple TVs. (Default: false)
  • manufacturer: Set the manufacturer name for display in the Home app. (Default: Homebridge)
  • model: Set the model for display in the Home app. (Default: Camera FFmpeg)
  • serialNumber: Set the serial number for display in the Home app. (Default: SerialNumber)
  • firmwareRevision: Set the firmware revision for display in the Home app. (Default: current plugin version)
  • unbridge: Bridged cameras can cause slowdowns of the entire Homebridge instance. If unbridged, the camera will need to be added to HomeKit manually. (Default: false)

Config Example with Manufacturer and Model Set

{
  "platform": "Camera-ffmpeg",
  "cameras": [
    {
      "name": "Camera Name",
      "manufacturer": "ACME, Inc.",
      "model": "ABC-123",
      "serialNumber": "1234567890",
      "firmwareRevision": "1.0",
      "videoConfig": {
        "source": "-i rtsp://username:password@example.com:554",
        "stillImageSource": "-i http://example.com/still_image.jpg",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 30
      }
    }
  ]
}

Optional videoConfig Parameters

  • returnAudioTarget: (EXPERIMENTAL - WIP) The FFmpeg output command for directing audio back to a two-way capable camera. This feature is still in development and a configuration that works today may not work in the future.
  • maxStreams: The maximum number of streams that will be allowed at once to this camera. (Default: 2)
  • maxWidth: The maximum width used for video streamed to HomeKit. If set to 0, the resolution of the source is used. If not set, will use any size HomeKit requests.
  • maxHeight: The maximum height used for video streamed to HomeKit. If set to 0, the resolution of the source is used. If not set, will use any size HomeKit requests.
  • maxFPS: The maximum frame rate used for video streamed to HomeKit. If set to 0, the framerate of the source is used. If not set, will use any frame rate HomeKit requests.
  • maxBitrate: The maximum bitrate used for video streamed to HomeKit, in kbit/s. If not set, will use any bitrate HomeKit requests.
  • forceMax: If set, the settings requested by HomeKit will be overridden with any 'maximum' values defined in this config. (Default: false)
  • vcodec: Set the codec used for encoding video sent to HomeKit, must be H.264-based. You can change to a hardware accelerated video codec with this option, if one is available. (Default: libx264)
  • audio: Enables audio streaming from camera. (Default: false)
  • packetSize: If audio or video is choppy try a smaller value, should be set to a multiple of 188. (Default: 1316)
  • mapvideo: Selects the stream used for video. (Default: FFmpeg automatically selects a video stream)
  • mapaudio: Selects the stream used for audio. (Default: FFmpeg automatically selects an audio stream)
  • videoFilter: Comma-delimited list of additional video filters for FFmpeg to run on the video. If 'none' is included, the default video filters are disabled.
  • encoderOptions: Options to be passed to the video encoder. (Default: -preset ultrafast -tune zerolatency if using libx264)
  • debug: Includes debugging output from the main FFmpeg process in the Homebridge log. (Default: false)
  • debugReturn: Includes debugging output from the FFmpeg used for return audio in the Homebridge log. (Default: false)

More Complicated Example

{
  "platform": "Camera-ffmpeg",
  "cameras": [
    {
      "name": "Camera Name",
      "videoConfig": {
        "source": "-i rtsp://myfancy_rtsp_stream",
        "stillImageSource": "-i http://faster_still_image_grab_url/this_is_optional.jpg",
        "maxStreams": 2,
        "maxWidth": 1280,
        "maxHeight": 720,
        "maxFPS": 30,
        "maxBitrate": 200,
        "vcodec": "h264_omx",
        "audio": false,
        "packetSize": 188,
        "hflip": true,
        "additionalCommandline": "-x264-params intra-refresh=1:bframes=0",
        "debug": true
      }
    }
  ]
}

Camera MQTT Parameters

  • motionTopic: The MQTT topic to watch for motion alerts.
  • motionMessage: The message to watch for to trigger motion alerts. Will use the name of the camera if blank.
  • motionResetTopic: The MQTT topic to watch for motion resets.
  • motionResetMessage: The message to watch for to trigger motion resets. Will use the name of the camera if blank.
  • doorbellTopic: The MQTT topic to watch for doorbell alerts.
  • doorbellMessage: The message to watch for to trigger doorbell alerts. Will use the name of the camera if blank.

Camera MQTT Example

{
  "platform": "Camera-ffmpeg",
  "cameras": [
    {
      "name": "Camera Name",
      "videoConfig": {
        "source": "-i rtsp://myfancy_rtsp_stream"
      },
      "mqtt": {
        "motionTopic": "home/camera",
        "motionMessage": "ON",
        "motionResetTopic": "home/camera",
        "motionResetMessage": "OFF",
        "doorbellTopic": "home/doobell",
        "doorbellMessage": "ON"
      }
    }
  ]
}

Automation Parameters

  • mqtt: Defines the hostname or IP of the MQTT broker to connect to for MQTT-based automation. If not set, MQTT support is not started. See the project site for more information on using MQTT.
  • portmqtt: The port of the MQTT broker. (Default: 1883)
  • tlsmqtt: Use TLS to connect to the MQTT broker. (Default: false)
  • usermqtt: The username used to connect to your MQTT broker. If not set, no authentication is used.
  • passmqtt: The password used to connect to your MQTT broker. If not set, no authentication is used.
  • porthttp: The port to listen on for HTTP-based automation. If not set, HTTP support is not started. See the project site for more information on using HTTP.
  • localhttp: Only allow HTTP calls from localhost. Useful if using helper plugins that translate to HTTP. (Default: false)

Automation Example

{
  "platform": "Camera-ffmpeg",
  "mqtt": "127.0.0.1",
  "porthttp": "8080",
  "cameras": []
}

Rarely Needed Parameters

  • videoProcessor: Defines which video processor is used to decode and encode videos, must take the same parameters as FFmpeg. Common uses would be avconv or the path to a custom-compiled version of FFmpeg. If not set, will use the included version of FFmpeg, or the version of FFmpeg installed on the system if no included version is available.

Rare Option Example

{
  "platform": "Camera-ffmpeg",
  "videoProcessor": "/usr/bin/ffmpeg",
  "cameras": []
}

Credit

Homebridge Camera FFmpeg is based on code originally written by Khaos Tian.

  • 实现CCTV在线摄像头监控的方案还可以使用(个人开源,商用收费)开源的流媒体服务:shinobivideo 环境:ubuntu 1.sudo su 2.apt install git -y 3.git clone https://gitlab.com/Shinobi-Systems/Shinobi.git Shinobi 4.cd Shinobi 5.chmod +x INSTALL/ubuntu

  • clion下配置了一天,给自己做个笔记 Mac系统并不支持链接静态库,在clion里面使用第三方库,必须把lib和 include头文件,文件夹导入工程目录,不然一直回现实头文件找不到。 set(FFMPEG_DIR, /usr/local/ffmpeg)作为引入路径,并不work CMAKE文件这样写就OK了 cmake_minimum_required(VERSION 3.22) projec

  • 对于camera 模块除了逻辑之外,我关注的点就内存的使用,后续还会写些内存相关的部分。这里只探讨如何申请buffer。 当前buffer申请分为 enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, V4L2_MEMORY_DMABUF = 4, }; mmap是下面详

  • 今天跟摄像头录制视频干上了,遇到一些麻烦,搜索到一个类似的问题,直接上链接: http://www.diqisoft.com/technical/20087.htm https://www.yanning.wang/archives/424.html 我现在要去尝试一下文章末尾提到的“AForge.Video.VFW也是可以将图片转换为Avi视频的”这个方法了,后续再补上这个方法是否可行。  

  • step1 下载项目 git clone https://git.ffmpeg.org/ffmpeg.git cd ffmpeg step2 配置帮助 查看帮助 ./configure --help 查看可用的编码器 ./configure --list-encoders 查看可用的解码器 ./configure --list-decoders 查看可用的过滤器 ./configure -

  • X264的安装 https://code.videolan.org/videolan/x264.git cd x264 ./configure --prefix=/usr --libdir=/usr/lib64 --enable-shared make install 如果以上configure提示Found no assembler,Minimum version is nasm-XXX啥的请

  • file=new File(sdcard+"ok.mp4"); if (!file.exists()){ try { file.createNewFile(); }catch (IOException e){ } } try{ // File file1=new Fil

  •   使用opencv1.1.0 编译得到结果: checking for  library containting avcodec_decode_video ... no checking for sws_getcontext in -lswscale ... no 编译ffmpeg时候,xvoid的问题。ffmpeg 版本需要大于0.4.9_p20070616-r1或者vlc-0.8.x 在/e

  • ffplay -list_devices true -f dshow -i dummy ffplay -f dshow -i video="USB Camera" ffplay -list_options true -f dshow -i video="USB Camera" ffmpeg -f dshow -video_device_number 1 -i video="USB Camera"

  • frameworks/av/camera/ 生成libcamera_client共享库,是与相机相关的 开始觉得有点疑惑,怎么头文件全都不见了? 原来它们都被整理放到了frameworks/av/include/camera文件夹里 但是又有问题出现了,我看到Android.mk里的LOCAL_C_INCLUDES值里面没有它们的踪迹,怎么编译就没有出问题了? 原来它们的路径已经编入了全局路径里,

  • http://www.evermeet.cx/ffmpeg/ ffmpeg version 2.4.3-tessus Copyright (c) 2000-2014 the FFmpeg developers   built on Nov  3 2014 23:01:10 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5

 相关资料
  • camera.ui camera.ui is a homebridge user interface to control your RTSP capable cameras. It supports almost everything you need for a camera user interface. Live streams on Web Web App with push notif

  • homebridge-mijia-camera Homebridge plugin for the Xiaomi Mijia 1080P Smart IP Camera, also known as Mi Home Security Camera. For now the plugin only allows turning on and off the camera. Installation

  • homebridge-website-to-camera Homebridge plugin for displaying a Website (intended for Google Maps-->Traffic) as Camera If you find my work useful you can buy me a coffee, I am very thankful for your s

  • Unifi-Protect-Camera-Motion This Homebridge plugin allows you to add your Unifi Protect Cameras (and their Motion Sensors) to Homekit.It adds smart detection by using a machine learning model to detec

  • Camera The camera object provides access to the device's default camera application. Important privacy note: Collection and use of images from a device's camera raises important privacy issues. Your a

  • new LSGlobe.Camera(scene) 相机类,它由位置、方向和视锥体定义。 视锥体(viewing frustum)由6个(上、下、左、右、近、远)平面限定,每个平面可由Cartesian4对象表示,其中x,y和z分量定义垂直于平面的单位向量,w分量是平面距原点/相机位置的距离。 Name Type Description scene Scene 场景对象 Example: // 创