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

Add support for UMED Łódź #47

Open
gbaranski opened this issue Dec 3, 2023 · 0 comments
Open

Add support for UMED Łódź #47

gbaranski opened this issue Dec 3, 2023 · 0 comments

Comments

@gbaranski
Copy link
Owner

gbaranski commented Dec 3, 2023

package main

import (
	"fmt"
	"wheretopark/collector/cctv"

	"github.com/bluenviron/gortsplib/v4"
	"github.com/bluenviron/gortsplib/v4/pkg/base"
	"gocv.io/x/gocv"
)

func GetWithGortsplib(url string) {
	c := gortsplib.Client{}

	// parse URL
	u, err := base.ParseURL(url)
	if err != nil {
		panic(err)
	}

	// connect to the server
	err = c.Start(u.Scheme, u.Host)
	if err != nil {
		panic(err)
	}
	defer c.Close()

	options, err := c.Options(u)
	if err != nil {
		panic(err)
	}

	fmt.Printf("options: %+v\n", options)

	// find available medias
	desc, _, err := c.Describe(u)
	if err != nil {
		panic(err)
	}

	fmt.Printf("desc: %+v\n", desc)

}

func GetWithFFMpeg(url string) {
	img, err := cctv.GetImageFromCamera(url)
	if err != nil {
		panic(err)
	}
	window := gocv.NewWindow("Hello")
	for {
		window.IMShow(img)
		window.WaitKey(1)
	}

}

func main() {
	url := "rtsp:///Streaming/Channels/101"
	GetWithFFMpeg(url)

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant