go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

MSE stream shrinks camera horizontally

Open felipecrs opened this issue 1 year ago • 2 comments

My camera resolution is 640x352 (not exactly 16:9, 16:9 would be 640x360). When I stream it over WebRTC, everything is ok:

image

But when I stream it over MSE, the video is shrunken horizontally:

image

Is this normal? Can something be done about it?

felipecrs avatar Nov 26 '24 15:11 felipecrs

Show probe info from WebUI and attach mp4 file from go2rtc, 1 second will be enough. You can use this API: https://github.com/AlexxIT/go2rtc/wiki/Snapshot-to-Telegram#record-from-h264-or-h265-camera

AlexxIT avatar Nov 27 '24 09:11 AlexxIT

{
  "producers": [
    {
      "id": 11,
      "format_name": "rtsp",
      "protocol": "rtsp+tcp",
      "remote_addr": "192.168.1.33:554",
      "url": "rtsp://admin:[email protected]/0/av1",
      "sdp": "v=0\r\no=StreamingServer 3331435948 1116907222000 IN IP4 192.168.1.33\r\ns=h264.mp4\r\ni=TAS-Tech Live Cast\r\nc=IN IP4 192.168.1.33\r\nt=0 0\r\na=recvonly\r\na=range:npt=now-\r\nm=video 0 RTP/AVP 96\r\na=control:rtsp://192.168.1.33:554/0/video1\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1\r\na=framesize:96 1280-720\r\nm=audio 0 RTP/AVP 8\r\na=control:rtsp://192.168.1.33:554/0/audio\r\na=rtpmap:8 pcma/8000\r\na=ptime:40\r\n\r\n",
      "user_agent": "go2rtc/1.9.7",
      "medias": [
        "video, recvonly, H264",
        "audio, recvonly, PCMA/8000"
      ],
      "receivers": [
        {
          "id": 12,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "childs": [
            13,
            21
          ],
          "bytes": 2710068,
          "packets": 3664
        },
        {
          "id": 14,
          "codec": {
            "codec_name": "pcm_alaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "childs": [
            15,
            22
          ],
          "bytes": 1535360,
          "packets": 4798
        }
      ],
      "bytes_recv": 4346972
    }
  ],
  "consumers": [
    {
      "id": 10,
      "format_name": "mse/fmp4",
      "protocol": "ws",
      "remote_addr": "192.168.1.15:34601",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, H264, H265",
        "audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML, OPUS"
      ],
      "senders": [
        {
          "id": 13,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "parent": 12,
          "bytes": 2710068,
          "packets": 3664
        },
        {
          "id": 15,
          "codec": {
            "codec_name": "flac",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 14,
          "bytes": 1535360,
          "packets": 4798
        }
      ],
      "bytes_send": 6596707
    },
    {
      "id": 20,
      "format_name": "probe",
      "protocol": "http",
      "remote_addr": "192.168.1.15:51215",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, ALL",
        "audio, sendonly, ALL",
        "audio, recvonly, ANY"
      ],
      "senders": [
        {
          "id": 21,
          "codec": {
            "codec_name": "h264",
            "codec_type": "video"
          },
          "parent": 12
        },
        {
          "id": 22,
          "codec": {
            "codec_name": "pcm_alaw",
            "codec_type": "audio",
            "sample_rate": 8000
          },
          "parent": 14
        }
      ]
    }
  ]
}

https://github.com/user-attachments/assets/0c43eebe-68dd-4959-a2a5-5ecb56215bc7

felipecrs avatar Nov 27 '24 10:11 felipecrs

I'm experiencing the same thing.

track0x1 avatar Dec 15 '24 02:12 track0x1

Many similar issues - moved the description of the problem.

AlexxIT avatar Mar 09 '25 04:03 AlexxIT

@AlexxIT which issue should I watch then?

felipecrs avatar Mar 09 '25 13:03 felipecrs

Sorry, found it: https://github.com/AlexxIT/go2rtc/issues/1634

GitHub Android app doesn't show the linked issue when closed with duplicate.

felipecrs avatar Mar 09 '25 13:03 felipecrs