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
5.02k stars 400 forks source link

Use ELD-AAC for HomeKit cameras #837

Open civita opened 10 months ago

civita commented 10 months ago

Hi,

I would like to know if there's a way to use eld-aac rather than opus for HomeKit audio since opus has known issue for choppy sounds. I tried to use ffmpeg args suggested here (-c:a libfdk_aac -profile:a aac_eld) with custom (nonfree) build ffmpeg binary, but it is recognized as MPEG4-GENERIC only and on the other hand, comsumer (HomeKit) only accept OPUS currently.

{
    "producers": [
        {
            "type": "RTSP active producer",
            "url": "...",
            "remote_addr": "...",
            "user_agent": "go2rtc/1.8.4",
            "sdp": "v=0\r\no=- 1 1 IN IP4 0.0.0.0\r\ns=go2rtc/1.8.4\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 0 RTP/AVP 96\r\na=rtpmap:96 MPEG4-GENERIC/8000\r\na=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=F8F62000\r\na=control:trackID=0\r\nm=video 0 RTP/AVP 97\r\na=rtpmap:97 H264/90000\r\na=fmtp:97 packetization-mode=1; sprop-parameter-sets=Z01AKKaAeAIn5ZsgAAADACAAAAMCkIA=,aO48gA==; profile-level-id=4D4028\r\na=control:trackID=1\r\n",
            "medias": [
                "audio, recvonly, MPEG4-GENERIC/8000",
                "video, recvonly, H.264 Main 4.0"
            ],
            "receivers": [
                "97 H264, bytes=912956, senders=1"
            ],
            "recv": 1015365
        }
    ],
    "consumers": [
        {
            "type": "HomeKit passive consumer",
            "remote_addr": "10.8.0.31:51815",
            "sdp": "{CodecType:0 CodecParams:[{ProfileID:[1] Level:[2] PacketizationMode:0 CVOEnabled:[] CVOID:[]}] VideoAttrs:[{Width:1280 Height:720 Framerate:30}] RTPParams:[{PayloadType:99 SSRC:75540579 MaxBitrate:299 RTCPInterval:0.5 MaxMTU:[1378] ComfortNoisePayloadType:[]}]}\n{CodecType:3 CodecParams:[{Channels:1 Bitrate:0 SampleRate:[1] RTPTime:[20]}] RTPParams:[{PayloadType:110 SSRC:2778159904 MaxBitrate:24 RTCPInterval:5 MaxMTU:[] ComfortNoisePayloadType:[13]}] ComfortNoise:[0]}",
            "medias": [
                "video, sendonly, H264",
                "audio, sendonly, OPUS"
            ],
            "senders": [
                "97 H264, bytes=912956, receivers=1"
            ],
            "send": 936228
        }
    ]
}

Thanks!

AlexxIT commented 10 months ago

This format not supported yet because require to have not default FFmpeg version.