Total rework FLV client

This commit is contained in:
Alexey Khit
2023-08-13 15:42:42 +03:00
parent e9795e7521
commit 0b6fda2af5
11 changed files with 703 additions and 8 deletions
+5 -7
View File
@@ -10,10 +10,10 @@ import (
"github.com/AlexxIT/go2rtc/internal/streams"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/flv"
"github.com/AlexxIT/go2rtc/pkg/magic"
"github.com/AlexxIT/go2rtc/pkg/mjpeg"
"github.com/AlexxIT/go2rtc/pkg/multipart"
"github.com/AlexxIT/go2rtc/pkg/rtmp"
"github.com/AlexxIT/go2rtc/pkg/tcp"
)
@@ -54,14 +54,12 @@ func handleHTTP(url string) (core.Producer, error) {
return multipart.NewClient(res)
case "video/x-flv":
var conn *rtmp.Client
if conn, err = rtmp.Accept(res); err != nil {
client := flv.NewClient(res.Body)
if err = client.Describe(); err != nil {
return nil, err
}
if err = conn.Describe(); err != nil {
return nil, err
}
return conn, nil
client.URL = url
return client, nil
default: // "video/mpeg":
}