Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram video does not play in iOS, but plays in Windows #1553

Open
BeybarsKZ opened this issue Jan 17, 2025 · 13 comments
Open

Telegram video does not play in iOS, but plays in Windows #1553

BeybarsKZ opened this issue Jan 17, 2025 · 13 comments
Labels
question Further information is requested

Comments

@BeybarsKZ
Copy link

Hello everyone. Please tell me how to solve the problem... The task: to receive video (with sound) in Telegram from the Hikvision DS-KV8113-WME1 video intercom when there is a call. I did everything: I received a call event via Hikvision doorbell, I received a stream from the camera with sound via native go2rtc, sending video to Telegram also worked:

- data:
url: >-
http://localhost:1984/api/stream.mp4?src=hikvision_door_station&mp4=flac&duration=15&filename=record.mp4
target: xxxxxxxxx
caption: Call
action: telegram_bot.send_video

The video arrives in Telegram, BUT it does not play on iOS (there is a static picture and sound). I checked it in Telegram (Windows version) and it plays both video and sound normally. How can I make it play in iOS?

@AlexxIT AlexxIT added the question Further information is requested label Jan 17, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 17, 2025

You need to attach a file to the issue for review. You can cover the camera with a cloth.

@BeybarsKZ
Copy link
Author

BeybarsKZ commented Jan 17, 2025

Im sorry - this is my first time opening an issue

go2rtc file:

streams:
  hikvision_door_station:
     - rtsp://admin:***192.168.22.14:554/Streaming/Channels/101
     - isapi://admin:***192.168.22.14:80/

HA front-end card:

type: custom:webrtc-camera
url: hikvision_door_station

In home assistant I see the video of the camera and hear the sound that the camera transmits

part of automatization:
      - conditions:
          - condition: trigger
            id:
              - hikvision_doorbell_ring
        sequence:
          - data:
              url: http://localhost:1984/api/frame.mp4?src=hikvision_door_station
              target: -******
              caption: Звонок в дверь
            action: telegram_bot.send_photo
          - data:
              url: >-
                http://localhost:1984/api/stream.mp4?src=hikvision_door_station&mp4=flac&duration=15&filename=record.mp4
              target: -******
              caption: Звонок в дверь
            action: telegram_bot.send_video

Sorry, I don't know how to attach the final file that was sent to telegram.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 17, 2025

You can open this link in any browser. But use server IP address instead of localhost.
Also you should have duration and filename params in the URL.

@BeybarsKZ
Copy link
Author

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2025

You need to open access to this file.

@BeybarsKZ
Copy link
Author

Sorry. Done.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2025

I'm confirming the problem. The video does not play in QuickTime at all. Some kind of problem with the stream from the camera.

Can you show stream probe from the go2rtc WebUI?

@BeybarsKZ
Copy link
Author

BeybarsKZ commented Jan 18, 2025

{
  "producers": [
    {
      "id": 132,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "192.168.22.20:554",
      "url": "rtsp://admin:[email protected]:554/Streaming/Channels/101",
      "sdp": "v=0\r\no=- 1737239956950932 1737239956950932 IN IP4 192.168.22.20\r\ns=Media Presentation\r\ne=NONE\r\nb=AS:5100\r\nt=0 0\r\na=control:rtsp://192.168.22.20:554/Streaming/Channels/101/\r\nm=video 0 RTP/AVP 96\r\nb=AS:5000\r\na=control:rtsp://192.168.22.20:554/Streaming/Channels/101/trackID=1\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=\r\nm=audio 0 RTP/AVP 8\r\nb=AS:50\r\na=control:rtsp://192.168.22.20:554/Streaming/Channels/101/trackID=2\r\na=rtpmap:8 PCMA/8000\r\na=Media_header:MEDIAINFO=494D4B48010100000400010011710110401F0000000;\r\na=appversion:1.0\r\n",
      "user_agent": "go2rtc/1.9.8",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, PCMA/8000"
      ],
      "receivers": [
        {
          "id": 134,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "childs": [
            135,
            140
          ],
          "bytes": 2711852,
          "packets": 2229
        },
        {
          "id": 137,
          "codec": {
            "codec_name": "pcm_alaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "childs": [
            138,
            141
          ],
          "bytes": 148800,
          "packets": 465
        }
      ],
      "bytes_recv": 2893700
    },
    {
      "id": 2150146272,
      "format_name": "isapi",
      "protocol": "http",
      "medias": [
        "audio, sendonly, PCMA/8000"
      ],
      "senders": [
        {
          "id": 143,
          "codec": {
            "codec_name": "ANY",
            "codec_type": ""
          },
          "parent": 142
        }
      ]
    }
  ],
  "consumers": [
    {
      "id": 133,
      "format_name": "webrtc",
      "protocol": "ws",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/132.0.6834.78 Mobile/15E148 Safari/604.1",
      "medias": [
        "video, sendonly, H264, H265, VP8, VP9",
        "audio, sendonly, OPUS/48000/2, G722/8000, PCMU/8000, PCMA/8000, L16, PCML"
      ],
      "senders": [
        {
          "id": 135,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "parent": 134,
          "bytes": 2711852,
          "packets": 2229
        },
        {
          "id": 138,
          "codec": {
            "codec_name": "pcm_alaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 137,
          "bytes": 40960,
          "packets": 128,
          "drops": 337
        }
      ]
    },
    {
      "id": 139,
      "format_name": "probe",
      "protocol": "http",
      "remote_addr": "172.30.32.2:45510 forwarded 2.73.209.64, 172.30.33.8, 172.30.32.1",
      "user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/132.0.6834.78 Mobile/15E148 Safari/604.1",
      "medias": [
        "video, sendonly, ALL",
        "audio, sendonly, ALL",
        "audio, recvonly, ANY"
      ],
      "receivers": [
        {
          "id": 142,
          "codec": {
            "codec_name": "ANY",
            "codec_type": ""
          },
          "childs": [
            143
          ]
        }
      ],
      "senders": [
        {
          "id": 140,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "parent": 134
        },
        {
          "id": 141,
          "codec": {
            "codec_name": "pcm_alaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 137
        }
      ]
    }
  ]
}

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2025

Thanks. I was expecting this.
The camera does not send codec information. And go2rtc is trying to guess it. And it's guessing wrong.
Some players don't see this as a problem. And some players can't play the video.

That's the camera's problem. It takes a lot of work to support a camera like this.

@BeybarsKZ
Copy link
Author

It's sad to hear that. What should I do now? Can't this problem be solved in any way?

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2025

You can use ffmpeg source for your rtsp source. It will add start delay, but fix the problem. There are no other options.

@BeybarsKZ
Copy link
Author

Can you send me link for doc about ffmpeg in my car? Or some examples

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 19, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants