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.21k stars 344 forks source link

Youtube pusblish issue - no video in new translation #1214

Open RodinAlexey opened 2 months ago

RodinAlexey commented 2 months ago

Привет, Алекс.

go2rtc version: 1.9.4 (Windows 10 x64)

One rtsp stream from video-encoder. VLC codec info for this RTSP stream:

Stream 0:
Codec: H264 - MPEG-4 AVC (part 10) (h264)
Type: Video
Resolution video: 1920x1080
Buffer size: 1920x1088
30 fps

Stream 1:
Code: MPEG AAC Audio (mp4a)
Channels: Sterep
Freq: 48000 Hz
Bit: 32

Config:

streams:
  mix: 
  - rtsp://192.168.33.251/mix

api:
  listen: ":1984"
  origin: '*'

ffmpeg:
  bin: "ffmpeg"  
  output: -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}    

rtsp:
  listen: ":8554"
  default_query: "video&audio"  

srtp:
  listen: ":8443"

webrtc:
  listen: ":8555/tcp"  

log:
  format: "color"
  level: info # default level
  api: trace
  exec: debug
  rtsp: warn
  streams: trace
  webrtc: fatal  

POST request: http://192.168.1.152:1984/api/streams?src=mix&dst=rtmp://a.rtmp.youtube.com/live2/vz2g-dmj8-rvq8-4sqz-xxxx

Logs:

TRC [api] POST /api/streams?src=mix&dst=rtmp://a.rtmp.youtube.com/live2/vz2g-dmj8-rvq8-4sqz-xxxx 192.168.1.133:53469
07:59:53.212 TRC [streams] check cons=0 media=video, sendonly, H264
07:59:53.226 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
07:59:53.228 TRC [streams] match cons=0 <= prod=0
07:59:53.232 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
07:59:53.233 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
07:59:53.233 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
07:59:53.234 TRC [streams] match cons=0 <= prod=0
07:59:53.237 DBG [streams] start producer url=rtsp://192.168.33.251/mix
07:59:53.262 DBG [streams] stop producer url=rtsp://192.168.33.251/mix
07:59:53.263 TRC [streams] stop reconnect url=rtsp://192.168.33.251/mix
07:59:58.271 TRC [streams] check cons=0 media=video, sendonly, H264
07:59:58.277 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
07:59:58.278 TRC [streams] match cons=0 <= prod=0
07:59:58.283 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
07:59:58.283 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
07:59:58.284 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
07:59:58.284 TRC [streams] match cons=0 <= prod=0
07:59:58.288 DBG [streams] start producer url=rtsp://192.168.33.251/mix
07:59:58.309 DBG [streams] stop producer url=rtsp://192.168.33.251/mix
07:59:58.309 TRC [streams] stop reconnect url=rtsp://192.168.33.251/mix
08:00:03.315 TRC [streams] check cons=0 media=video, sendonly, H264
08:00:03.321 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
08:00:03.322 TRC [streams] match cons=0 <= prod=0
08:00:03.324 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
08:00:03.324 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
08:00:03.324 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
08:00:03.324 TRC [streams] match cons=0 <= prod=0
08:00:03.328 DBG [streams] start producer url=rtsp://192.168.33.251/mix
08:00:03.351 DBG [streams] stop producer url=rtsp://192.168.33.251/mix
08:00:03.351 TRC [streams] stop reconnect url=rtsp://192.168.33.251/mix
08:00:08.363 TRC [streams] check cons=0 media=video, sendonly, H264
08:00:08.367 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
08:00:08.368 TRC [streams] match cons=0 <= prod=0
08:00:08.372 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
08:00:08.372 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
08:00:08.373 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
08:00:08.373 TRC [streams] match cons=0 <= prod=0
08:00:08.375 DBG [streams] start producer url=rtsp://192.168.33.251/mix
08:00:08.396 DBG [streams] stop producer url=rtsp://192.168.33.251/mix
08:00:08.396 TRC [streams] stop reconnect url=rtsp://192.168.33.251/mix
xaionaro commented 1 month ago

Having seemingly the same problem.

Config:

publish:
  test0:
    - rtmp://a.rtmp.youtube.com:1935/live2/xxxx-xxxx-xxxx-xxxx-xxxx

streams:
  test0: rtmp://localhost:1936/test

log:
  level: trace
  publish: trace
  api: debug
  rtmp: trace
  streams: trace

Log:

xaionaro@void:~/go/src/github.com/AlexxIT/go2rtc$ go run ./
12:55:47.392 INF go2rtc platform=linux/amd64 revision= version=1.9.4
12:55:47.392 DBG build vcs.time= version=go1.22.1
12:55:47.392 INF config path=/home/xaionaro/go/src/github.com/AlexxIT/go2rtc/go2rtc.yaml
12:55:47.393 INF [rtsp] listen addr=:8554
12:55:47.393 INF [api] listen addr=:1984
12:55:47.393 INF [webrtc] listen addr=:8555/tcp
12:55:47.393 TRC [hass] can't import config: open .storage/core.config_entries: no such file or directory
12:55:48.393 TRC [streams] check cons=0 media=video, sendonly, H264
12:55:48.394 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:48.394 TRC [streams] match cons=0 <= prod=0
12:55:48.394 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
12:55:48.394 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:48.394 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
12:55:48.394 TRC [streams] match cons=0 <= prod=0
12:55:48.394 DBG [streams] start producer url=rtmp://localhost:1936/test
12:55:48.449 DBG [streams] stop producer url=rtmp://localhost:1936/test
12:55:53.453 TRC [streams] check cons=0 media=video, sendonly, H264
12:55:53.454 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:53.454 TRC [streams] match cons=0 <= prod=0
12:55:53.454 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
12:55:53.454 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:53.454 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
12:55:53.454 TRC [streams] match cons=0 <= prod=0
12:55:53.454 DBG [streams] start producer url=rtmp://localhost:1936/test
12:55:53.591 DBG [streams] stop producer url=rtmp://localhost:1936/test
12:55:58.595 TRC [streams] check cons=0 media=video, sendonly, H264
12:55:58.597 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:58.597 TRC [streams] match cons=0 <= prod=0
12:55:58.597 TRC [streams] check cons=0 media=audio, sendonly, MPEG4-GENERIC
12:55:58.597 TRC [streams] check cons=0 prod=0 media=video, recvonly, H264
12:55:58.597 TRC [streams] check cons=0 prod=0 media=audio, recvonly, MPEG4-GENERIC/48000/2
12:55:58.597 TRC [streams] match cons=0 <= prod=0
12:55:58.597 DBG [streams] start producer url=rtmp://localhost:1936/test
12:55:58.732 DBG [streams] stop producer url=rtmp://localhost:1936/test

In tcpdump I see it tried to connect to youtube, but reset the connection after FCPublish.

The same behavior at 1.9.3. Meanwhile 1.9.2 doesn't even try to connect to the youtube server and hangs at:

xaionaro@void:~/go/src/github.com/AlexxIT/go2rtc$ go run ./
13:00:28.385 INF go2rtc platform=linux/amd64 revision= version=1.9.2
13:00:28.385 DBG build vcs.time= version=go1.22.1
13:00:28.385 INF config path=/home/xaionaro/go/src/github.com/AlexxIT/go2rtc/go2rtc.yaml
13:00:28.386 INF [rtsp] listen addr=:8554
13:00:28.386 INF [webrtc] listen addr=:8555/tcp
13:00:28.386 INF [api] listen addr=:1984
13:00:28.386 DBG [hass] can't import config: open .storage/core.config_entries: no such file or directory
13:00:29.386 TRC [streams] check cons=0 media=video, sendonly, H264