AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.3k stars 353 forks source link

Problem with H265 stream conversion for HomeKit #1350

Open motogon opened 1 week ago

motogon commented 1 week ago

Problem with 265 stream conversion for HomeKit

config:

streams: vorota:

docker NVIDIA-SMI 535.154.05 Driver Version: 535.154.05 CUDA Version: 12.2

compose.yaml :

services: go2rtc: image: alexxit/go2rtc:latest-hardware network_mode: host # important for WebRTC, HomeKit, UDP cameras privileged: true # only for FFmpeg hardware transcoding restart: unless-stopped # autorestart on fail or config change from WebUI environment:

logs:

16:15:02,661 info go2rtc version=1.9.4 platform=linux/amd64 revision=a4885c2 16:15:02,661 debug build version=go1.22.4 vcs.time=2024-06-18T18:33:36Z 16:15:02,661 info config path=/config/go2rtc.yaml 16:15:02,662 info [api] listen addr=:1984 16:15:02,662 info [rtsp] listen addr=:8554 16:15:02,663 info [webrtc] listen addr=:8555/tcp 16:15:14,110 debug [webrtc] new consumer src=vorota 16:15:14,324 debug [ffmpeg] bin version=6.1.1-4+b3 libavformat=60. 16.100 16:15:14,509 debug [exec] run rtsp args=ffmpeg,-hide_banner,-v,error,-fflags,nobuffer,-flags,low_delay,-timeout,5000000,-user_agent,go2rtc/ffmpeg,-rtsp_flags,prefer_tcp,-i,rtsp://127.0.0.1:8554/vorota?video,-c:v,libx264,-g,50,-profile:v,high,-level:v,4.1,-preset:v,superfast,-tune:v,zerolatency,-pix_fmt:v,yuv420p,-an,-user_agent,ffmpeg/go2rtc,-rtsp_transport,tcp,-f,rtsp,rtsp://127.0.0.1:8554/23eff33496809909ab5fd81b4e76975a 16:15:14,634 debug [rtsp] new consumer stream=vorota 16:15:14,636 debug [streams] start producer url=rtsp://syno:3e787bc76ca03605946b3db425ea08ca@192.168.3.57:554/Sms=28.unicast 16:15:17,725 debug [exec] [hevc @ 0x5626b0626940] Could not find ref with POC 0 16:15:17,948 debug [exec] run rtsp launch=3.438369504s 16:15:17,949 debug [exec] run rtsp args=ffmpeg,-hide_banner,-v,error,-fflags,nobuffer,-flags,low_delay,-timeout,5000000,-user_agent,go2rtc/ffmpeg,-rtsp_flags,prefer_tcp,-i,rtsp://127.0.0.1:8554/vorota?audio,-c:a,libopus,-application:a,lowdelay,-min_comp,0,-vn,-user_agent,ffmpeg/go2rtc,-rtsp_transport,tcp,-f,rtsp,rtsp://127.0.0.1:8554/ab0ebc158855e0064aa9310ce447ee6b 16:15:17,962 debug [streams] start producer url=ffmpeg:vorota#video=h264#hardware 16:15:18,074 debug [exec] [rtsp @ 0x5626b05dd640] RTP: PT=60: bad cseq 42b6 expected=2c27 16:15:18,106 debug [rtsp] new consumer stream=vorota 16:15:18,368 debug [exec] run rtsp launch=419.170572ms 16:15:18,369 debug [streams] stop producer url=ffmpeg:vorota#audio=opus 16:15:18,376 debug [rtsp] handle error=EOF 16:15:18,376 debug [rtsp] disconnect stream=vorota 16:15:18,380 error undefined error=unable to populate media section, RTPSender created with no codecs caller=github.com/AlexxIT/go2rtc/internal/webrtc/webrtc.go:183 16:16:14,638 debug [rtsp] handle error=read tcp 127.0.0.1:8554->127.0.0.1:58368: i/o timeout 16:16:14,638 debug [rtsp] disconnect stream=vorota 16:20:40,448 debug [streams] stop producer url=rtsp://syno:3e787bc76ca03605946b3db425ea08ca@192.168.3.57:554/Sms=28.unicast 16:20:40,448 debug [streams] stop producer url=ffmpeg:vorota#video=h264#hardware

bagobones commented 1 day ago

What resolution is the source video, a 4k or higher camera may be outside the homekit spec or limits of the h264 encoder.

motogon commented 1 day ago

What resolution is the source video, a 4k or higher camera may be outside the homekit spec or limits of the h264 encoder.

resolution is the source video 2880x1616 h265