mrlt8 / docker-wyze-bridge

WebRTC/RTSP/RTMP/LL-HLS bridge for Wyze cams in a docker container
GNU Affero General Public License v3.0
2.64k stars 163 forks source link

feature request: HA addon: include ffmpeg binary from container's debian release #875

Open gtxaspec opened 1 year ago

gtxaspec commented 1 year ago

including ffmpeg binary from container's debian release supports more encoders, as well as hardware acceleration (even though its older)

ffmpeg -encoders | grep h264
 V..... libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V..... libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V..... h264_omx             OpenMAX IL H.264 video encoder (codec h264)
 V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 encoder wrapper (codec h264)
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)

HA addon: add option to specify path to ffmpeg binary, possibly even specifying path to custom ffmpeg version? (ala frigate)

mrlt8 commented 1 year ago

IIRC, we're using the static builds to reduce the image size, but we could look into alternate ffmpeg binaries.

Codel1417 commented 1 year ago

I would love to use qsv on my (off brand) nuc to reduce CPU usage.

mrlt8 commented 1 year ago

Unless you're doing rotation or forcing the footage to be re-encoded, you probably won't see much improvements in performance. This is because the bridge utilizes the "-v:c copy" command for the h264 video, which essentially copies the video stream without any decoding/encoding.

btw, the ffmpeg in hw build mrlt8/wyze-bridge:latest-hw should support qsv, though you will have to manually specify the command and map /dev/dri:/dev/dri.

 V....D libx264              libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V....D libx264rgb           libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264)
 V....D libopenh264          OpenH264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
 V....D h264_amf             AMD AMF H.264 Encoder (codec h264)
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_qsv             H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration) (codec h264)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 encoder wrapper (codec h264)
 V....D h264_vaapi           H.264/AVC (VAAPI) (codec h264)
Codel1417 commented 1 year ago

I am doing forced re-encoding as frigate was crashing without it. Not sure where the issue actually is but it worked as a solution.