roleoroleo / yi-hack-Allwinner-v2

Custom firmware for Yi 1080p camera based on Allwinner platform
MIT License
808 stars 92 forks source link

Backchannel #907

Open kiddyfurby opened 1 month ago

kiddyfurby commented 1 month ago

Was try to get backchannel working with go2rtc, noticed that the camera doesn't advertise that capability. in go2rtc 1.9.2, the info link shows the following json for yi-hack-allwinner-v2

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.19.24/ch0_0.h264/",
      "remote_addr": "192.168.19.24:554",
      "user_agent": "go2rtc/1.9.2",
      "sdp": "...",
      "medias": [
        "video, recvonly, H.264 High 3.2",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],
      "receivers": [
        "96 H264, bytes=51545563, senders=1",
        "97 MPEG4-GENERIC/16000, bytes=2645133, senders=1"
      ],
      "recv": 54874236
    }
  ],

My other camera which has backchannel support has an additional entry audio, sendonly, PCMU/8000 in producers.medias

roleoroleo commented 1 month ago

There is a type with G711 that I need to fix. Try with AAC and let me know if it works.

kiddyfurby commented 1 month ago

It's already set to AAC.

roleoroleo commented 1 month ago

This is my output:

{
  "producers": [
    {
      "id": 2,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "192.168.0.245:554",
      "url": "rtsp://192.168.0.245/ch0_0.h264",
      "sdp": "...",
      "user_agent": "go2rtc/1.9.4",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, PCMU/8000",
        "audio, sendonly, MPEG4-GENERIC/16000"
      ],
...

Check the configuration. Are you using the last version of the hack?

kiddyfurby commented 1 month ago

Yes I am on 0.3.2

Firmware Version | 0.3.2
Base Version | 9.0.09.06_202103291039
Model Suffix | y29ga

I noticed that you're on go2rtc 1.9.4 so I upgraded just to make sure, now my json is like this:

{
  "producers": [
    {
      "id": 43,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "192.168.19.24:554",
      "url": "rtsp://192.168.19.24/ch0_0.h264",
      "sdp": "...",
      "user_agent": "go2rtc/1.9.4",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],

I have non-alt rtsp server, onvif on, rtsp audio set to aac, onvif discovery on, onvif high, backchannel aac

roleoroleo commented 1 month ago

Better, but the 3rd media should be sendonly.

Do you have another cam that works with go2rtc? I need to check the messages between the cam and the software. Check this issue too: https://github.com/roleoroleo/onvif_simple_server/issues/10#issuecomment-2249893385

kiddyfurby commented 1 month ago

my other camera (not a allwinner-v2) that has a backchannel looks like this:

{
  "producers": [
    {
      "id": 5822,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "192.168.1.42:554",
      "url": "rtsp://192.168.1.42/Preview_01_sub",
      "sdp": "...",
      "user_agent": "go2rtc/1.9.4",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "audio, sendonly, PCMU/8000"
      ]
roleoroleo commented 1 month ago

Apart from the codec, it's the same ouput I receive from my rtsp.